You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let funding_pubkey = PublicKey::from_secret_key(secp_ctx,&self.funding_key);
199
+
let remote_funding_pubkey = self.remote_funding_pubkey.as_ref().expect("must set remote funding key before signing");
200
+
let channel_funding_redeemscript = make_funding_redeemscript(&funding_pubkey, remote_funding_pubkey);
201
+
189
202
let commitment_sighash = hash_to_message!(&bip143::SighashComponents::new(&commitment_tx).sighash_all(&commitment_tx.input[0],&channel_funding_redeemscript, channel_value_satoshis)[..]);
190
203
let commitment_sig = secp_ctx.sign(&commitment_sighash,&self.funding_key);
191
204
@@ -222,6 +235,11 @@ impl ChannelKeys for InMemoryChannelKeys {
222
235
let msghash = hash_to_message!(&Sha256dHash::hash(&msg.encode()[..])[..]);
Copy file name to clipboardExpand all lines: lightning/src/ln/channel.rs
+12-15
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ use ln::msgs;
20
20
use ln::msgs::{DecodeError,OptionalField,DataLossProtect};
21
21
use ln::channelmonitor::ChannelMonitor;
22
22
use ln::channelmanager::{PendingHTLCStatus,HTLCSource,HTLCFailReason,HTLCFailureMsg,PendingForwardHTLCInfo,RAACommitmentOrder,PaymentPreimage,PaymentHash,BREAKDOWN_TIMEOUT,MAX_LOCAL_BREAKDOWN_TIMEOUT};
23
-
use ln::chan_utils::{LocalCommitmentTransaction,TxCreationKeys,HTLCOutputInCommitment,HTLC_SUCCESS_TX_WEIGHT,HTLC_TIMEOUT_TX_WEIGHT};
23
+
use ln::chan_utils::{LocalCommitmentTransaction,TxCreationKeys,HTLCOutputInCommitment,HTLC_SUCCESS_TX_WEIGHT,HTLC_TIMEOUT_TX_WEIGHT, make_funding_redeemscript};
24
24
use ln::chan_utils;
25
25
use chain::chaininterface::{FeeEstimator,ConfirmationTarget};
let remote_keys = self.build_remote_transaction_keys()?;
1427
1422
let remote_initial_commitment_tx = self.build_commitment_transaction(self.cur_remote_commitment_transaction_number,&remote_keys,false,false,self.feerate_per_kw).0;
1428
-
let remote_signature = self.local_keys.sign_remote_commitment(self.channel_value_satoshis,&self.get_funding_redeemscript(),self.feerate_per_kw,&remote_initial_commitment_tx,&remote_keys,&Vec::new(),self.our_to_self_delay,&self.secp_ctx)
1423
+
let remote_signature = self.local_keys.sign_remote_commitment(self.channel_value_satoshis,self.feerate_per_kw,&remote_initial_commitment_tx,&remote_keys,&Vec::new(),self.our_to_self_delay,&self.secp_ctx)
1429
1424
.map_err(|_| ChannelError::Close("Failed to get signatures for new commitment_signed"))?.0;
1430
1425
1431
1426
// We sign the "remote" commitment transaction, allowing them to broadcast the tx if they wish.
let remote_keys = self.build_remote_transaction_keys()?;
3153
3149
let remote_initial_commitment_tx = self.build_commitment_transaction(self.cur_remote_commitment_transaction_number,&remote_keys,false,false,self.feerate_per_kw).0;
let res = self.local_keys.sign_remote_commitment(self.channel_value_satoshis,&self.get_funding_redeemscript(),feerate_per_kw,&remote_commitment_tx.0,&remote_keys,&htlcs,self.our_to_self_delay,&self.secp_ctx)
3458
+
let res = self.local_keys.sign_remote_commitment(self.channel_value_satoshis, feerate_per_kw,&remote_commitment_tx.0,&remote_keys,&htlcs,self.our_to_self_delay,&self.secp_ctx)
3463
3459
.map_err(|_| ChannelError::Close("Failed to get signatures for new commitment_signed"))?;
0 commit comments