Skip to content

Commit dc4a616

Browse files
committed
Use channel parameters in sign_holder_htlc_transaction
Now that channel_value_satoshis has been moved to ChannelTransactionParameters, InMemorySigner no longer needs a copy. Remove indirect uses of the copy from TestChannelSigner.
1 parent 0428302 commit dc4a616

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lightning/src/util/test_channel_signer.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ use crate::ln::msgs::PartialSignatureWithNonce;
3737
#[cfg(taproot)]
3838
use crate::sign::taproot::TaprootChannelSigner;
3939
use crate::sign::HTLCDescriptor;
40-
use crate::types::features::ChannelTypeFeatures;
4140
use crate::util::ser::{Writeable, Writer};
4241
use bitcoin::secp256k1;
4342
#[cfg(taproot)]
@@ -139,10 +138,6 @@ impl TestChannelSigner {
139138
Self { inner, state, disable_revocation_policy_check }
140139
}
141140

142-
pub fn channel_type_features(&self) -> &ChannelTypeFeatures {
143-
self.inner.channel_type_features().unwrap()
144-
}
145-
146141
#[cfg(test)]
147142
pub fn get_enforcement_state(&self) -> MutexGuard<EnforcementState> {
148143
self.state.lock().unwrap()
@@ -376,7 +371,10 @@ impl EcdsaChannelSigner for TestChannelSigner {
376371
assert_eq!(htlc_tx.output[input], htlc_descriptor.tx_output(secp_ctx));
377372
{
378373
let witness_script = htlc_descriptor.witness_script(secp_ctx);
379-
let sighash_type = if self.channel_type_features().supports_anchors_zero_fee_htlc_tx() {
374+
let channel_parameters =
375+
&htlc_descriptor.channel_derivation_parameters.transaction_parameters;
376+
let channel_type_features = &channel_parameters.channel_type_features;
377+
let sighash_type = if channel_type_features.supports_anchors_zero_fee_htlc_tx() {
380378
EcdsaSighashType::SinglePlusAnyoneCanPay
381379
} else {
382380
EcdsaSighashType::All
@@ -391,7 +389,7 @@ impl EcdsaChannelSigner for TestChannelSigner {
391389
.unwrap();
392390
let countersignatory_htlc_key = HtlcKey::from_basepoint(
393391
&secp_ctx,
394-
&self.inner.counterparty_pubkeys().unwrap().htlc_basepoint,
392+
&channel_parameters.counterparty_pubkeys().unwrap().htlc_basepoint,
395393
&htlc_descriptor.per_commitment_point,
396394
);
397395

0 commit comments

Comments
 (0)