mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-25 23:30:59 +01:00
Avoid double-panic in ChannelManager when tests fail
This commit is contained in:
parent
28e67db327
commit
8d706789e7
1 changed files with 5 additions and 3 deletions
|
@ -2462,11 +2462,13 @@ mod tests {
|
||||||
}
|
}
|
||||||
impl Drop for Node {
|
impl Drop for Node {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
|
if !::std::thread::panicking() {
|
||||||
// Check that we processed all pending events
|
// Check that we processed all pending events
|
||||||
assert_eq!(self.node.get_and_clear_pending_events().len(), 0);
|
assert_eq!(self.node.get_and_clear_pending_events().len(), 0);
|
||||||
assert_eq!(self.chan_monitor.added_monitors.lock().unwrap().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) {
|
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();
|
node_a.node.create_channel(node_b.node.get_our_node_id(), 100000, 10001, 42).unwrap();
|
||||||
|
|
Loading…
Add table
Reference in a new issue