mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-06 23:54:22 +01:00
state: fix BITCOIN_HTLC_TOTHEM_SPENT idata.
We use both union fields idata->btc and idata->htlc, which is clearly wrong. Have peer_tx_revealed_r_value return the HTLC it's talking about. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
5
state.c
5
state.c
@@ -757,10 +757,11 @@ enum command_status state(const tal_t *ctx,
|
||||
return next_state(peer, cstatus,
|
||||
BITS_TO_STATE(bits));
|
||||
} else if (input_is(input, BITCOIN_HTLC_TOTHEM_SPENT)) {
|
||||
const struct htlc *htlc;
|
||||
/* They revealed R value. */
|
||||
peer_tx_revealed_r_value(peer, idata->btc);
|
||||
htlc = peer_tx_revealed_r_value(peer, idata->btc);
|
||||
/* We don't care any more. */
|
||||
peer_unwatch_htlc_output(peer, idata->htlc,
|
||||
peer_unwatch_htlc_output(peer, htlc,
|
||||
INPUT_NO_MORE_HTLCS);
|
||||
return unchanged_state(cstatus);
|
||||
} else if (input_is(input, BITCOIN_HTLC_TOTHEM_TIMEOUT)){
|
||||
|
||||
Reference in New Issue
Block a user