Skip to content

Commit 65cdf15

Browse files
author
Antoine Riard
committed
Rename MonitorEvent::CommitmentTxBroadcasted to CommitmentTxConfirmed
1 parent e32545a commit 65cdf15

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ pub enum MonitorEvent {
190190
/// A monitor event containing an HTLCUpdate.
191191
HTLCEvent(HTLCUpdate),
192192

193-
/// A monitor event that the Channel's commitment transaction was broadcasted.
194-
CommitmentTxBroadcasted(OutPoint),
193+
/// A monitor event that the Channel's commitment transaction was confirmed.
194+
CommitmentTxConfirmed(OutPoint),
195195
}
196196

197197
/// Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
@@ -918,7 +918,7 @@ impl<Signer: Sign> Writeable for ChannelMonitorImpl<Signer> {
918918
0u8.write(writer)?;
919919
upd.write(writer)?;
920920
},
921-
MonitorEvent::CommitmentTxBroadcasted(_) => 1u8.write(writer)?
921+
MonitorEvent::CommitmentTxConfirmed(_) => 1u8.write(writer)?
922922
}
923923
}
924924

@@ -1787,7 +1787,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
17871787
log_info!(logger, "Broadcasting local {}", log_tx!(tx));
17881788
broadcaster.broadcast_transaction(tx);
17891789
}
1790-
self.pending_monitor_events.push(MonitorEvent::CommitmentTxBroadcasted(self.funding_info.0));
1790+
self.pending_monitor_events.push(MonitorEvent::CommitmentTxConfirmed(self.funding_info.0));
17911791
}
17921792

17931793
pub fn update_monitor<B: Deref, F: Deref, L: Deref>(&mut self, updates: &ChannelMonitorUpdate, broadcaster: &B, fee_estimator: &F, logger: &L) -> Result<(), MonitorUpdateError>
@@ -1835,7 +1835,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
18351835
} else if !self.holder_tx_signed {
18361836
log_error!(logger, "You have a toxic holder commitment transaction avaible in channel monitor, read comment in ChannelMonitor::get_latest_holder_commitment_txn to be informed of manual action to take");
18371837
} else {
1838-
// If we generated a MonitorEvent::CommitmentTxBroadcasted, the ChannelManager
1838+
// If we generated a MonitorEvent::CommitmentTxConfirmed, the ChannelManager
18391839
// will still give us a ChannelForceClosed event with !should_broadcast, but we
18401840
// shouldn't print the scary warning above.
18411841
log_info!(logger, "Channel off-chain state closed after we broadcasted our latest commitment transaction.");
@@ -2357,7 +2357,7 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
23572357
let funding_outp = HolderFundingOutput::build(self.funding_redeemscript.clone());
23582358
let commitment_package = PackageTemplate::build_package(self.funding_info.0.txid.clone(), self.funding_info.0.index as u32, PackageSolvingData::HolderFundingOutput(funding_outp), self.best_block.height(), false, self.best_block.height());
23592359
claimable_outpoints.push(commitment_package);
2360-
self.pending_monitor_events.push(MonitorEvent::CommitmentTxBroadcasted(self.funding_info.0));
2360+
self.pending_monitor_events.push(MonitorEvent::CommitmentTxConfirmed(self.funding_info.0));
23612361
let commitment_tx = self.onchain_tx_handler.get_fully_signed_holder_tx(&self.funding_redeemscript);
23622362
self.holder_tx_signed = true;
23632363
// Because we're broadcasting a commitment transaction, we should construct the package
@@ -3110,7 +3110,7 @@ impl<'a, Signer: Sign, K: KeysInterface<Signer = Signer>> ReadableArgs<&'a K>
31103110
for _ in 0..pending_monitor_events_len {
31113111
let ev = match <u8 as Readable>::read(reader)? {
31123112
0 => MonitorEvent::HTLCEvent(Readable::read(reader)?),
3113-
1 => MonitorEvent::CommitmentTxBroadcasted(funding_info.0),
3113+
1 => MonitorEvent::CommitmentTxConfirmed(funding_info.0),
31143114
_ => return Err(DecodeError::InvalidValue)
31153115
};
31163116
pending_monitor_events.push(ev);

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3940,7 +3940,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
39403940
self.fail_htlc_backwards_internal(self.channel_state.lock().unwrap(), htlc_update.source, &htlc_update.payment_hash, HTLCFailReason::Reason { failure_code: 0x4000 | 8, data: Vec::new() });
39413941
}
39423942
},
3943-
MonitorEvent::CommitmentTxBroadcasted(funding_outpoint) => {
3943+
MonitorEvent::CommitmentTxConfirmed(funding_outpoint) => {
39443944
let mut channel_lock = self.channel_state.lock().unwrap();
39453945
let channel_state = &mut *channel_lock;
39463946
let by_id = &mut channel_state.by_id;

0 commit comments

Comments
 (0)