Skip to content

Commit 0487e74

Browse files
committed
[fuzz] Do not fail in FST if a channel is closed before we fund it
1 parent c6e8934 commit 0487e74

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

fuzz/src/full_stack.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ use lightning::ln::msgs::DecodeError;
3838
use lightning::routing::router::get_route;
3939
use lightning::routing::network_graph::NetGraphMsgHandler;
4040
use lightning::util::config::UserConfig;
41+
use lightning::util::errors::APIError;
4142
use lightning::util::events::{EventsProvider,Event};
4243
use lightning::util::enforcing_trait_impls::EnforcingSigner;
4344
use lightning::util::logger::Logger;
@@ -526,7 +527,13 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
526527
continue 'outer_loop;
527528
}
528529
};
529-
channelmanager.funding_transaction_generated(&funding_generation.0, tx.clone()).unwrap();
530+
if let Err(e) = channelmanager.funding_transaction_generated(&funding_generation.0, tx.clone()) {
531+
// Its possible the channel has been closed in the mean time, but any other
532+
// failure may be a bug.
533+
if let APIError::ChannelUnavailable { err } = e {
534+
assert_eq!(err, "No such channel");
535+
} else { panic!(); }
536+
}
530537
pending_funding_signatures.insert(funding_output, tx);
531538
}
532539
},

0 commit comments

Comments
 (0)