]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Fix `synchronize_listeners` calling default implementation
authorElias Rohrer <dev@tnull.de>
Thu, 10 Oct 2024 15:16:18 +0000 (17:16 +0200)
committerElias Rohrer <dev@tnull.de>
Thu, 10 Oct 2024 15:16:18 +0000 (17:16 +0200)
Previously, the `ChainListenerSet` `Listen` implementation wouldn't
forward to the listeners `block_connected` implementation outside of
tests. This would result in the default implementation of
`Listen::block_connected` being used and the listeners implementation
never being called.

lightning-block-sync/src/init.rs

index ae69518cee98dc869658455fef1f0b04e0087a11..430cda0928cbd3472dba58a771c816d763587e70 100644 (file)
@@ -239,8 +239,6 @@ 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 {