Browse Source

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>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
5a184c24e8
  1. 6
      channeld/full_channel.c

6
channeld/full_channel.c

@ -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…
Cancel
Save