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;
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);
}
},