From: Matt Corallo Date: Tue, 30 Apr 2024 21:30:26 +0000 (+0000) Subject: Wake `background-processor` from `ChainMonitor` on new blocks X-Git-Tag: v0.0.123-rc1~1^2~5^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=refs%2Fheads%2F2024-04-notify-bp-on-blocks;p=rust-lightning Wake `background-processor` from `ChainMonitor` on new blocks When we receive a new block we may generate `Event::SpendableOutputs` in `ChannelMonitor`s which then need to be processed by the background processor. While it will do so eventually when its normal loop goes around, this may cause user tests to be delayed in finding events, so we should notify the BP immediately to wake it on new blocks. We implement that here, unconditionally notifying the `background-processor` whenever we receive a new block or confirmed transactions. --- diff --git a/lightning/src/chain/chainmonitor.rs b/lightning/src/chain/chainmonitor.rs index 81ba30ffb..8e5670870 100644 --- a/lightning/src/chain/chainmonitor.rs +++ b/lightning/src/chain/chainmonitor.rs @@ -296,6 +296,8 @@ pub struct ChainMonitor Vec<(Txid, u32, Option)> {