Skip to content

Commit dd06c2a

Browse files
committed
Renamed script_for_p2wpkh to get_p2wpkh_redeemscript to match convention
1 parent a505df1 commit dd06c2a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lightning/src/ln/chan_utils.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ impl CommitmentTransaction {
11441144
let script = if opt_anchors {
11451145
get_to_countersignatory_with_anchors_redeemscript(&countersignatory_pubkeys.payment_point).to_v0_p2wsh()
11461146
} else {
1147-
script_for_p2wpkh(&countersignatory_pubkeys.payment_point)
1147+
get_p2wpkh_redeemscript(&countersignatory_pubkeys.payment_point)
11481148
};
11491149
txouts.push((
11501150
TxOut {
@@ -1439,7 +1439,7 @@ pub fn get_commitment_transaction_number_obscure_factor(
14391439
| ((res[31] as u64) << 0 * 8)
14401440
}
14411441

1442-
fn script_for_p2wpkh(key: &PublicKey) -> Script {
1442+
fn get_p2wpkh_redeemscript(key: &PublicKey) -> Script {
14431443
Builder::new().push_opcode(opcodes::all::OP_PUSHBYTES_0)
14441444
.push_slice(&WPubkeyHash::hash(&key.serialize())[..])
14451445
.into_script()
@@ -1450,7 +1450,7 @@ mod tests {
14501450
use super::CounterpartyCommitmentSecrets;
14511451
use ::{hex, chain};
14521452
use prelude::*;
1453-
use ln::chan_utils::{get_to_countersignatory_with_anchors_redeemscript, script_for_p2wpkh, CommitmentTransaction, TxCreationKeys, ChannelTransactionParameters, CounterpartyChannelTransactionParameters, HTLCOutputInCommitment};
1453+
use ln::chan_utils::{get_to_countersignatory_with_anchors_redeemscript, get_p2wpkh_redeemscript, CommitmentTransaction, TxCreationKeys, ChannelTransactionParameters, CounterpartyChannelTransactionParameters, HTLCOutputInCommitment};
14541454
use bitcoin::secp256k1::{PublicKey, SecretKey, Secp256k1};
14551455
use util::test_utils;
14561456
use chain::keysinterface::{KeysInterface, BaseSign};
@@ -1493,7 +1493,7 @@ mod tests {
14931493
&mut htlcs_with_aux, &channel_parameters.as_holder_broadcastable()
14941494
);
14951495
assert_eq!(tx.built.transaction.output.len(), 2);
1496-
assert_eq!(tx.built.transaction.output[1].script_pubkey, script_for_p2wpkh(&counterparty_pubkeys.payment_point));
1496+
assert_eq!(tx.built.transaction.output[1].script_pubkey, get_p2wpkh_redeemscript(&counterparty_pubkeys.payment_point));
14971497

14981498
// Generate broadcaster and counterparty outputs as well as two anchors
14991499
let tx = CommitmentTransaction::new_with_auxiliary_htlc_data(

0 commit comments

Comments
 (0)