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,9 +2462,11 @@ mod tests {
|
||||||
}
|
}
|
||||||
impl Drop for Node {
|
impl Drop for Node {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
// Check that we processed all pending events
|
if !::std::thread::panicking() {
|
||||||
assert_eq!(self.node.get_and_clear_pending_events().len(), 0);
|
// Check that we processed all pending events
|
||||||
assert_eq!(self.chan_monitor.added_monitors.lock().unwrap().len(), 0);
|
assert_eq!(self.node.get_and_clear_pending_events().len(), 0);
|
||||||
|
assert_eq!(self.chan_monitor.added_monitors.lock().unwrap().len(), 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue