Avoid double-panic in ChannelManager when tests fail

This commit is contained in:
Matt Corallo 2018-09-27 17:36:10 -04:00
parent 28e67db327
commit 8d706789e7

View file

@ -2462,11 +2462,13 @@ mod tests {
}
impl Drop for Node {
fn drop(&mut self) {
if !::std::thread::panicking() {
// Check that we processed all pending events
assert_eq!(self.node.get_and_clear_pending_events().len(), 0);
assert_eq!(self.chan_monitor.added_monitors.lock().unwrap().len(), 0);
}
}
}
fn create_chan_between_nodes(node_a: &Node, node_b: &Node) -> (msgs::ChannelAnnouncement, msgs::ChannelUpdate, msgs::ChannelUpdate, [u8; 32], Transaction) {
node_a.node.create_channel(node_b.node.get_our_node_id(), 100000, 10001, 42).unwrap();