From: Matt Corallo Date: Wed, 21 Apr 2021 00:35:23 +0000 (+0000) Subject: [fuzz] Do not fail in FST if a channel is closed before we fund it X-Git-Tag: v0.0.98~10^2~3 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=a53764a58b8b9e412aa5f66eb4789954c6afc963;p=rust-lightning [fuzz] Do not fail in FST if a channel is closed before we fund it --- diff --git a/fuzz/src/full_stack.rs b/fuzz/src/full_stack.rs index 52b37a10f..0613d3a0a 100644 --- a/fuzz/src/full_stack.rs +++ b/fuzz/src/full_stack.rs @@ -39,6 +39,7 @@ use lightning::ln::msgs::DecodeError; use lightning::routing::router::get_route; use lightning::routing::network_graph::NetGraphMsgHandler; use lightning::util::config::UserConfig; +use lightning::util::errors::APIError; use lightning::util::events::Event; use lightning::util::enforcing_trait_impls::EnforcingSigner; use lightning::util::logger::Logger; @@ -531,7 +532,13 @@ pub fn do_test(data: &[u8], logger: &Arc) { continue 'outer_loop; } }; - channelmanager.funding_transaction_generated(&funding_generation.0, tx.clone()).unwrap(); + if let Err(e) = channelmanager.funding_transaction_generated(&funding_generation.0, tx.clone()) { + // It's possible the channel has been closed in the mean time, but any other + // failure may be a bug. + if let APIError::ChannelUnavailable { err } = e { + assert_eq!(err, "No such channel"); + } else { panic!(); } + } pending_funding_signatures.insert(funding_output, tx); } },