Skip to content

Commit 9dbec80

Browse files
committed
Correct name of get_counterparty_payment_script method
`get_counterparty_payment_script` fetches the countersigner's (i.e. non-broadcaster) payment script, but that could be ours or or counterparty's. Thus, it should read `get_countersigner_payment_script`, which we fix here.
1 parent 06a6c3e commit 9dbec80

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1857,7 +1857,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
18571857

18581858
assert!(commitment_transaction_number_obscure_factor <= (1 << 48));
18591859
let holder_pubkeys = &channel_parameters.holder_pubkeys;
1860-
let counterparty_payment_script = chan_utils::get_counterparty_payment_script(
1860+
let counterparty_payment_script = chan_utils::get_countersigner_payment_script(
18611861
&channel_parameters.channel_type_features, &holder_pubkeys.payment_point
18621862
);
18631863

lightning/src/ln/chan_utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,9 +637,9 @@ pub fn get_revokeable_redeemscript(revocation_key: &RevocationKey, contest_delay
637637
res
638638
}
639639

640-
/// Returns the script for the counterparty's output on a holder's commitment transaction based on
641-
/// the channel type.
642-
pub fn get_counterparty_payment_script(
640+
/// Returns the script for the countersigner's (i.e. non-broadcaster's) output on a commitment
641+
/// transaction based on the channel type.
642+
pub fn get_countersigner_payment_script(
643643
channel_type_features: &ChannelTypeFeatures, payment_key: &PublicKey,
644644
) -> ScriptBuf {
645645
if channel_type_features.supports_anchors_zero_fee_htlc_tx() {

lightning/src/sign/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use crate::chain::transaction::OutPoint;
4141
use crate::crypto::utils::{hkdf_extract_expand_twice, sign, sign_with_aux_rand};
4242
use crate::ln::chan_utils;
4343
use crate::ln::chan_utils::{
44-
get_counterparty_payment_script, get_revokeable_redeemscript, make_funding_redeemscript,
44+
get_countersigner_payment_script, get_revokeable_redeemscript, make_funding_redeemscript,
4545
ChannelPublicKeys, ChannelTransactionParameters, ClosingTransaction, CommitmentTransaction,
4646
HTLCOutputInCommitment, HolderCommitmentTransaction,
4747
};
@@ -1295,8 +1295,8 @@ impl InMemorySigner {
12951295

12961296
let payment_point_v1 = PublicKey::from_secret_key(secp_ctx, &self.payment_key_v1);
12971297
let payment_point_v2 = PublicKey::from_secret_key(secp_ctx, &self.payment_key_v2);
1298-
let spk_v1 = get_counterparty_payment_script(channel_type_features, &payment_point_v1);
1299-
let spk_v2 = get_counterparty_payment_script(channel_type_features, &payment_point_v2);
1298+
let spk_v1 = get_countersigner_payment_script(channel_type_features, &payment_point_v1);
1299+
let spk_v2 = get_countersigner_payment_script(channel_type_features, &payment_point_v2);
13001300

13011301
let (remotepubkey, payment_key) = if spk_v1 == descriptor.output.script_pubkey {
13021302
(bitcoin::PublicKey::new(payment_point_v1), &self.payment_key_v1)
@@ -2102,8 +2102,8 @@ impl KeysManager {
21022102
.expect("Your RNG is busted")
21032103
.private_key;
21042104
let pubkey = PublicKey::from_secret_key(secp_ctx, &key);
2105-
res.push(get_counterparty_payment_script(&static_remote_key_features, &pubkey));
2106-
res.push(get_counterparty_payment_script(&zero_fee_htlc_features, &pubkey));
2105+
res.push(get_countersigner_payment_script(&static_remote_key_features, &pubkey));
2106+
res.push(get_countersigner_payment_script(&zero_fee_htlc_features, &pubkey));
21072107
}
21082108
res
21092109
}

0 commit comments

Comments
 (0)