X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-block-sync%2Fsrc%2Finit.rs;h=7a8fada9c3c5b03663e586f137e05eb43c9b8903;hb=dc28f9bb88735152260c4c96ae23f98cef32c979;hp=b3f745bd26e361e670e66436abb7b1dae7310979;hpb=dc8479a6202ea84489e51cba020a600f0a2b9695;p=rust-lightning diff --git a/lightning-block-sync/src/init.rs b/lightning-block-sync/src/init.rs index b3f745bd..7a8fada9 100644 --- a/lightning-block-sync/src/init.rs +++ b/lightning-block-sync/src/init.rs @@ -216,6 +216,16 @@ impl<'a, L: chain::Listen + ?Sized> chain::Listen for DynamicChainListener<'a, L struct ChainListenerSet<'a, L: chain::Listen + ?Sized>(Vec<(u32, &'a L)>); impl<'a, L: chain::Listen + ?Sized> chain::Listen for ChainListenerSet<'a, L> { + // Needed to differentiate test expectations. + #[cfg(test)] + fn block_connected(&self, block: &bitcoin::Block, height: u32) { + for (starting_height, chain_listener) in self.0.iter() { + if height > *starting_height { + chain_listener.block_connected(block, height); + } + } + } + fn filtered_block_connected(&self, header: &BlockHeader, txdata: &chain::transaction::TransactionData, height: u32) { for (starting_height, chain_listener) in self.0.iter() { if height > *starting_height {