pub(crate) user_channel_id: u128,
pub(crate) channel_capacity_satoshis: u64,
pub(crate) counterparty_node_id: PublicKey,
+ pub(crate) is_manual_broadcast: bool,
pub(crate) unbroadcasted_funding_tx: Option<Transaction>,
pub(crate) channel_funding_txo: Option<OutPoint>,
}
channel_capacity_satoshis: self.channel_value_satoshis,
counterparty_node_id: self.counterparty_node_id,
unbroadcasted_funding_tx,
+ is_manual_broadcast: self.is_manual_broadcast,
channel_funding_txo: self.get_funding_txo(),
}
}
channel_capacity_satoshis: self.context.channel_value_satoshis,
counterparty_node_id: self.context.counterparty_node_id,
unbroadcasted_funding_tx: self.context.unbroadcasted_funding(),
+ is_manual_broadcast: self.context.is_manual_broadcast,
channel_funding_txo: self.context.get_funding_txo(),
};
let tx = self.build_signed_closing_transaction(&mut closing_tx, &msg.signature, &sig);
channel_capacity_satoshis: self.context.channel_value_satoshis,
counterparty_node_id: self.context.counterparty_node_id,
unbroadcasted_funding_tx: self.context.unbroadcasted_funding(),
+ is_manual_broadcast: self.context.is_manual_broadcast,
channel_funding_txo: self.context.get_funding_txo(),
};
if closing_signed.is_some() {
let _ = self.chain_monitor.update_channel(funding_txo, &monitor_update);
}
let mut shutdown_results = Vec::new();
- let mut is_manual_broadcast = false;
if let Some(txid) = shutdown_res.unbroadcasted_batch_funding_txid {
let mut funding_batch_states = self.funding_batch_states.lock().unwrap();
let affected_channels = funding_batch_states.remove(&txid).into_iter().flatten();
if let Some(peer_state_mutex) = per_peer_state.get(&counterparty_node_id) {
let mut peer_state = peer_state_mutex.lock().unwrap();
if let Some(mut chan) = peer_state.channel_by_id.remove(&channel_id) {
- // We override the previous value, so we could change from true -> false,
- // but this is fine because if a channel has manual_broadcast set to false
- // we should choose the safier condition.
- is_manual_broadcast = chan.context().is_manual_broadcast();
update_maps_on_chan_removal!(self, &chan.context());
shutdown_results.push(chan.context_mut().force_shutdown(false, ClosureReason::FundingBatchClosure));
}
}, None));
if let Some(transaction) = shutdown_res.unbroadcasted_funding_tx {
- let funding_info = if is_manual_broadcast {
+ let funding_info = if shutdown_res.is_manual_broadcast {
FundingInfo::OutPoint {
outpoint: shutdown_res.channel_funding_txo
.expect("We had an unbroadcasted funding tx, so should also have had a funding outpoint"),