]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Add additional test coverage of `NetworkGraph` counters 2024-10-counter-test
authorMatt Corallo <git@bluematt.me>
Tue, 29 Oct 2024 18:08:47 +0000 (18:08 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 29 Oct 2024 18:10:03 +0000 (18:10 +0000)
This would have caught the bug fixed in 0c0cb6fccbb426924f21915053b
in our tests.

Suggested by @valentinewallace.

lightning/src/routing/gossip.rs

index c2e7e70ef07ee23fae9fe8f4a2843718e686357a..c552005d9caf223cf598e9711678dbb6f5a5cf2a 100644 (file)
@@ -2089,6 +2089,10 @@ where
                        };
                }
 
+               core::mem::drop(nodes);
+               core::mem::drop(channels);
+               self.test_node_counter_consistency();
+
                Ok(())
        }