+ 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!(); }
+ }