channeld: add extra check to channel_force_htlcs.
None of these sanity checks should fail, but let's be thorough: we were testing for htlc->fail but not failcode when fulfilling an HTLC. The failing-htlc case had this correct already. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
efee948d3a
commit
5a184c24e8
|
@ -996,6 +996,12 @@ bool channel_force_htlcs(struct channel *channel,
|
|||
fulfilled[i].id);
|
||||
return false;
|
||||
}
|
||||
if (htlc->failcode) {
|
||||
status_trace("Fulfill %s HTLC %"PRIu64" already fail %u",
|
||||
fulfilled_sides[i] == LOCAL ? "out" : "in",
|
||||
fulfilled[i].id, htlc->failcode);
|
||||
return false;
|
||||
}
|
||||
if (!htlc_has(htlc, HTLC_REMOVING)) {
|
||||
status_trace("Fulfill %s HTLC %"PRIu64" state %s",
|
||||
fulfilled_sides[i] == LOCAL ? "out" : "in",
|
||||
|
|
Loading…
Reference in New Issue