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
Struct-ify SpendableOutputDescriptor entries relevant to channels
Both SpendableOutputDescriptor::DynamicOutputP2WSH and
SpendableOutputDescriptor::StaticOutputCounterpartyPayment are
relevant only in the context of a given channel, making them
candidates for being passed into helper functions in
`InMemoryChannelKeys`. This moves them into their own structs so
that they can later be used standalone.
Copy file name to clipboardExpand all lines: lightning/src/chain/channelmonitor.rs
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ use ln::channelmanager::{HTLCSource, PaymentPreimage, PaymentHash};
43
43
use ln::onchaintx::{OnchainTxHandler,InputDescriptors};
44
44
use chain::chaininterface::{BroadcasterInterface,FeeEstimator};
45
45
use chain::transaction::{OutPoint,TransactionData};
46
-
use chain::keysinterface::{SpendableOutputDescriptor,ChannelKeys,KeysInterface};
46
+
use chain::keysinterface::{SpendableOutputDescriptor,StaticCounterpartyPaymentOutputDescriptor,DynamicP2WSHOutputDescriptor,ChannelKeys,KeysInterface};
47
47
use util::logger::Logger;
48
48
use util::ser::{Readable,ReadableArgs,MaybeReadable,Writer,Writeable,U48};
let keys = $keysinterface.derive_channel_keys($chan_value, key_derivation_params.0, key_derivation_params.1);
4685
+
let keys = $keysinterface.derive_channel_keys($chan_value,descriptor.key_derivation_params.0,descriptor.key_derivation_params.1);
4686
4686
let remotepubkey = keys.pubkeys().payment_point;
4687
4687
let witness_script = Address::p2pkh(&::bitcoin::PublicKey{compressed:true, key: remotepubkey},Network::Testnet).script_pubkey();
4688
-
let sighash = Message::from_slice(&bip143::SigHashCache::new(&spend_tx).signature_hash(0,&witness_script, output.value,SigHashType::All)[..]).unwrap();
4688
+
let sighash = Message::from_slice(&bip143::SigHashCache::new(&spend_tx).signature_hash(0,&witness_script,descriptor.output.value,SigHashType::All)[..]).unwrap();
4689
4689
let remotesig = secp_ctx.sign(&sighash,&keys.inner.payment_key);
let sighash = Message::from_slice(&bip143::SigHashCache::new(&spend_tx).signature_hash(0,&witness_script, output.value,SigHashType::All)[..]).unwrap();
4720
+
let sighash = Message::from_slice(&bip143::SigHashCache::new(&spend_tx).signature_hash(0,&witness_script,descriptor.output.value,SigHashType::All)[..]).unwrap();
4721
4721
let local_delayedsig = secp_ctx.sign(&sighash,&delayed_payment_key);
0 commit comments