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 htlcs_cloned:Vec<_> = commitment_tx.1.drain(..).map(|htlc_pair| (htlc_pair.0, htlc_pair.1.map(|source| (*source).clone()))).collect();
1674
+
(commitment_tx.0, htlcs_cloned)
1675
+
};
1672
1676
let local_commitment_txid = local_commitment_tx.0.txid();
1673
1677
let local_sighash = Message::from_slice(&bip143::SighashComponents::new(&local_commitment_tx.0).sighash_all(&local_commitment_tx.0.input[0],&funding_script,self.channel_value_satoshis)[..]).unwrap();
1674
1678
secp_check!(self.secp_ctx.verify(&local_sighash,&msg.signature,&self.their_funding_pubkey.unwrap()),"Invalid commitment tx signature from peer");
let remote_commitment_txid = remote_commitment_tx.0.txid();
3237
3241
let remote_sighash = Message::from_slice(&bip143::SighashComponents::new(&remote_commitment_tx.0).sighash_all(&remote_commitment_tx.0.input[0],&funding_script,self.channel_value_satoshis)[..]).unwrap();
3238
3242
let our_sig = self.secp_ctx.sign(&remote_sighash,&self.local_keys.funding_key);
let htlcs_no_ref = remote_commitment_tx.1.drain(..).map(|htlc_pair| (htlc_pair.0, htlc_pair.1.map(|source| source.clone()))).collect();
3250
3255
Ok((msgs::CommitmentSigned{
3251
3256
channel_id:self.channel_id,
3252
3257
signature: our_sig,
3253
3258
htlc_signatures: htlc_sigs,
3254
-
}, remote_commitment_tx))
3259
+
},(remote_commitment_tx.0, htlcs_no_ref)))
3255
3260
}
3256
3261
3257
3262
/// Adds a pending outbound HTLC to this channel, and creates a signed commitment transaction
@@ -3960,11 +3965,15 @@ mod tests {
3960
3965
let htlc_basepoint = PublicKey::from_secret_key(&secp_ctx,&chan.local_keys.htlc_base_key);
3961
3966
let keys = TxCreationKeys::new(&secp_ctx,&per_commitment_point,&delayed_payment_base,&htlc_basepoint,&chan.their_revocation_basepoint.unwrap(),&chan.their_payment_basepoint.unwrap(),&chan.their_htlc_basepoint.unwrap()).unwrap();
let htlcs = tx.1.drain(..).map(|htlc_pair| htlc_pair.0).collect();
3975
+
(tx.0, htlcs)
3976
+
};
3968
3977
let their_signature = Signature::from_der(&secp_ctx,&hex::decode($their_sig_hex).unwrap()[..]).unwrap();
3969
3978
let sighash = Message::from_slice(&bip143::SighashComponents::new(&unsigned_tx.0).sighash_all(&unsigned_tx.0.input[0],&chan.get_funding_redeemscript(), chan.channel_value_satoshis)[..]).unwrap();
0 commit comments