lightningd: fix assertion when funding depth changes fast.

We didn't apply the inflight to the channel struct before asserting, so
we can break test_rbf_non_last_mined:

```
lightningd: lightningd/dual_open_control.c:981: dualopend_tell_depth: Assertion `bitcoin_txid_eq(&channel->funding.txid, txid)' failed.
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-10-02 15:09:53 +10:30
parent 9561094433
commit 0b680c5f40

View File

@ -1041,11 +1041,11 @@ static enum watch_result opening_depth_cb(struct lightningd *ld,
wallet_channel_save(ld->wallet, inflight->channel);
}
dualopend_tell_depth(inflight->channel, txid, depth);
if (depth >= inflight->channel->minimum_depth)
update_channel_from_inflight(ld, inflight->channel, inflight);
dualopend_tell_depth(inflight->channel, txid, depth);
return KEEP_WATCHING;
}