lightningd: wait for onchaind to ack new spends before continuing replay.

Christian noted that if we don't do this we could flood onchaind with messages:
particularly in Greenlight where the HSM (remote) may delay indefinitely, so
onchaind doesn't process messages.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2024-11-13 13:24:28 +10:30
parent 0dc1c5a061
commit d57accfca7
4 changed files with 40 additions and 10 deletions

View File

@@ -1195,7 +1195,7 @@ static bool output_spent(struct tracked_output ***outs,
u32 input_num,
u32 tx_blockheight)
{
bool interesting;
bool interesting = false;
for (size_t i = 0; i < tal_count(*outs); i++) {
struct tracked_output *out = (*outs)[i];
@@ -1220,7 +1220,7 @@ static bool output_spent(struct tracked_output ***outs,
record_coin_movements(out, tx_blockheight,
&tx_parts->txid);
return interesting;
break;
}
htlc_outpoint.txid = tx_parts->txid;