Skip to content

Commit b289384

Browse files
author
Antoine Riard
committed
Rename RemoteTxCache as RemoteCommitmentTransaction and document better
We also remove an unecessary build warning.
1 parent d1d52cb commit b289384

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lightning/src/ln/channelmonitor.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -418,14 +418,14 @@ struct LocalSignedTx {
418418
htlc_outputs: Vec<(HTLCOutputInCommitment, Option<Signature>, Option<HTLCSource>)>,
419419
}
420420

421-
/// Cache remote basepoint to compute any transaction on
422-
/// remote outputs, either justice or preimage/timeout transactions.
421+
/// We use this to track remote commitment transactions and htlcs outputs and
422+
/// use it to generate any justice or 2nd-stage preimage/timeout transactions.
423423
#[derive(PartialEq)]
424-
struct RemoteTxCache {
424+
struct RemoteCommitmentTransaction {
425425
remote_delayed_payment_base_key: PublicKey,
426426
remote_htlc_base_key: PublicKey,
427427
on_remote_tx_csv: u16,
428-
per_htlc: HashMap<Txid, Vec<(HTLCOutputInCommitment)>>
428+
per_htlc: HashMap<Txid, Vec<HTLCOutputInCommitment>>
429429
}
430430

431431
/// When ChannelMonitor discovers an onchain outpoint being a step of a channel and that it needs
@@ -751,7 +751,7 @@ pub struct ChannelMonitor<ChanSigner: ChannelKeys> {
751751
current_remote_commitment_txid: Option<Txid>,
752752
prev_remote_commitment_txid: Option<Txid>,
753753

754-
remote_tx_cache: RemoteTxCache,
754+
remote_tx_cache: RemoteCommitmentTransaction,
755755
funding_redeemscript: Script,
756756
channel_value_satoshis: u64,
757757
// first is the idx of the first of the two revocation points
@@ -1089,7 +1089,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
10891089
let our_channel_close_key_hash = WPubkeyHash::hash(&shutdown_pubkey.serialize());
10901090
let shutdown_script = Builder::new().push_opcode(opcodes::all::OP_PUSHBYTES_0).push_slice(&our_channel_close_key_hash[..]).into_script();
10911091

1092-
let remote_tx_cache = RemoteTxCache { remote_delayed_payment_base_key: *remote_delayed_payment_base_key, remote_htlc_base_key: *remote_htlc_base_key, on_remote_tx_csv, per_htlc: HashMap::new() };
1092+
let remote_tx_cache = RemoteCommitmentTransaction { remote_delayed_payment_base_key: *remote_delayed_payment_base_key, remote_htlc_base_key: *remote_htlc_base_key, on_remote_tx_csv, per_htlc: HashMap::new() };
10931093

10941094
let mut onchain_tx_handler = OnchainTxHandler::new(destination_script.clone(), keys.clone(), on_local_tx_csv, logger.clone());
10951095

@@ -2299,7 +2299,7 @@ impl<ChanSigner: ChannelKeys + Readable> ReadableArgs<Arc<Logger>> for (BlockHas
22992299
return Err(DecodeError::InvalidValue);
23002300
}
23012301
}
2302-
RemoteTxCache {
2302+
RemoteCommitmentTransaction {
23032303
remote_delayed_payment_base_key,
23042304
remote_htlc_base_key,
23052305
on_remote_tx_csv,

0 commit comments

Comments
 (0)