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
// TODO: We really should be taking the SigHashCache as a parameter here instead of
516
514
// spend_tx, but ideally the SigHashCache would expose the transaction's inputs read-only
517
515
// so that we can check them. This requires upstream rust-bitcoin changes (as well as
@@ -522,23 +520,23 @@ impl InMemoryChannelKeys {
522
520
523
521
let remotepubkey = self.pubkeys().payment_point;
524
522
let witness_script = bitcoin::Address::p2pkh(&::bitcoin::PublicKey{compressed:true,key: remotepubkey},Network::Testnet).script_pubkey();
525
-
let sighash = hash_to_message!(&bip143::SigHashCache::new(&*spend_tx).signature_hash(input_idx,&witness_script, descriptor.output.value,SigHashType::All)[..]);
523
+
let sighash = hash_to_message!(&bip143::SigHashCache::new(spend_tx).signature_hash(input_idx,&witness_script, descriptor.output.value,SigHashType::All)[..]);
526
524
let remotesig = secp_ctx.sign(&sighash,&self.payment_key);
// TODO: We really should be taking the SigHashCache as a parameter here instead of
543
541
// spend_tx, but ideally the SigHashCache would expose the transaction's inputs read-only
544
542
// so that we can check them. This requires upstream rust-bitcoin changes (as well as
@@ -552,13 +550,15 @@ impl InMemoryChannelKeys {
552
550
.expect("We constructed the payment_base_key, so we can only fail here if the RNG is busted.");
553
551
let delayed_payment_pubkey = PublicKey::from_secret_key(&secp_ctx,&delayed_payment_key);
554
552
let witness_script = chan_utils::get_revokeable_redeemscript(&descriptor.revocation_pubkey, descriptor.to_self_delay,&delayed_payment_pubkey);
555
-
let sighash = hash_to_message!(&bip143::SigHashCache::new(&*spend_tx).signature_hash(input_idx,&witness_script, descriptor.output.value,SigHashType::All)[..]);
553
+
let sighash = hash_to_message!(&bip143::SigHashCache::new(spend_tx).signature_hash(input_idx,&witness_script, descriptor.output.value,SigHashType::All)[..]);
556
554
let local_delayedsig = secp_ctx.sign(&sighash,&delayed_payment_key);
0 commit comments