@@ -6976,8 +6976,7 @@ where
6976
6976
fn maybe_generate_initial_closing_signed(&self) -> bool {
6977
6977
let mut handle_errors: Vec<(PublicKey, Result<(), _>)> = Vec::new();
6978
6978
let mut has_update = false;
6979
- let mut shutdown_result = None;
6980
- let mut unbroadcasted_batch_funding_txid = None;
6979
+ let mut shutdown_results = Vec::new();
6981
6980
{
6982
6981
let per_peer_state = self.per_peer_state.read().unwrap();
6983
6982
@@ -6988,7 +6987,7 @@ where
6988
6987
peer_state.channel_by_id.retain(|channel_id, phase| {
6989
6988
match phase {
6990
6989
ChannelPhase::Funded(chan) => {
6991
- unbroadcasted_batch_funding_txid = chan.context.unbroadcasted_batch_funding_txid();
6990
+ let unbroadcasted_batch_funding_txid = chan.context.unbroadcasted_batch_funding_txid();
6992
6991
match chan.maybe_propose_closing_signed(&self.fee_estimator, &self.logger) {
6993
6992
Ok((msg_opt, tx_opt)) => {
6994
6993
if let Some(msg) = msg_opt {
@@ -7011,7 +7010,7 @@ where
7011
7010
log_info!(self.logger, "Broadcasting {}", log_tx!(tx));
7012
7011
self.tx_broadcaster.broadcast_transactions(&[&tx]);
7013
7012
update_maps_on_chan_removal!(self, &chan.context);
7014
- shutdown_result = Some ((None, Vec::new(), unbroadcasted_batch_funding_txid));
7013
+ shutdown_results.push ((None, Vec::new(), unbroadcasted_batch_funding_txid));
7015
7014
false
7016
7015
} else { true }
7017
7016
},
@@ -7033,7 +7032,7 @@ where
7033
7032
let _ = handle_error!(self, err, counterparty_node_id);
7034
7033
}
7035
7034
7036
- if let Some( shutdown_result) = shutdown_result {
7035
+ for shutdown_result in shutdown_results.drain(..) {
7037
7036
self.finish_close_channel(shutdown_result);
7038
7037
}
7039
7038
0 commit comments