projects
/
rust-lightning
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
366e796
)
Avoid double-panic in full_stack_target to assist debugging
2018-10-peer-free-panic
author
Matt Corallo
<git@bluematt.me>
Fri, 2 Nov 2018 14:54:25 +0000
(10:54 -0400)
committer
Matt Corallo
<git@bluematt.me>
Fri, 2 Nov 2018 14:54:25 +0000
(10:54 -0400)
fuzz/fuzz_targets/full_stack_target.rs
patch
|
blob
|
history
diff --git
a/fuzz/fuzz_targets/full_stack_target.rs
b/fuzz/fuzz_targets/full_stack_target.rs
index 19b3e843ae6706c7ef99d095b76b0c736b8a22c5..f943945531e834a854ebca0927288c57e46c108b 100644
(file)
--- a/
fuzz/fuzz_targets/full_stack_target.rs
+++ b/
fuzz/fuzz_targets/full_stack_target.rs
@@
-209,15
+209,17
@@
impl<'a> MoneyLossDetector<'a> {
impl<'a> Drop for MoneyLossDetector<'a> {
fn drop(&mut self) {
impl<'a> Drop for MoneyLossDetector<'a> {
fn drop(&mut self) {
- // Disconnect all peers
- for (idx, peer) in self.peers.borrow().iter().enumerate() {
- if *peer {
- self.handler.disconnect_event(&Peer{id: idx as u8, peers_connected: &self.peers});
+ if !::std::thread::panicking() {
+ // Disconnect all peers
+ for (idx, peer) in self.peers.borrow().iter().enumerate() {
+ if *peer {
+ self.handler.disconnect_event(&Peer{id: idx as u8, peers_connected: &self.peers});
+ }
}
}
- }
- // Force all channels onto the chain (and time out claim txn)
- self.manager.force_close_all_channels();
+ // Force all channels onto the chain (and time out claim txn)
+ self.manager.force_close_all_channels();
+ }
}
}
}
}