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