Skip to content

Commit c8df41d

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 6caaa54 commit c8df41d

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
@@ -36,7 +36,6 @@ use crate::ln::msgs::PartialSignatureWithNonce;
3636
#[cfg(taproot)]
3737
use crate::sign::taproot::TaprootChannelSigner;
3838
use crate::sign::HTLCDescriptor;
39-
use crate::types::features::ChannelTypeFeatures;
4039
use bitcoin::secp256k1;
4140
#[cfg(taproot)]
4241
use bitcoin::secp256k1::All;
@@ -137,10 +136,6 @@ impl TestChannelSigner {
137136
Self { inner, state, disable_revocation_policy_check }
138137
}
139138

140-
pub fn channel_type_features(&self) -> &ChannelTypeFeatures {
141-
self.inner.channel_type_features().unwrap()
142-
}
143-
144139
#[cfg(test)]
145140
pub fn get_enforcement_state(&self) -> MutexGuard<EnforcementState> {
146141
self.state.lock().unwrap()
@@ -374,7 +369,10 @@ impl EcdsaChannelSigner for TestChannelSigner {
374369
assert_eq!(htlc_tx.output[input], htlc_descriptor.tx_output(secp_ctx));
375370
{
376371
let witness_script = htlc_descriptor.witness_script(secp_ctx);
377-
let sighash_type = if self.channel_type_features().supports_anchors_zero_fee_htlc_tx() {
372+
let channel_parameters =
373+
&htlc_descriptor.channel_derivation_parameters.transaction_parameters;
374+
let channel_type_features = &channel_parameters.channel_type_features;
375+
let sighash_type = if channel_type_features.supports_anchors_zero_fee_htlc_tx() {
378376
EcdsaSighashType::SinglePlusAnyoneCanPay
379377
} else {
380378
EcdsaSighashType::All
@@ -389,7 +387,7 @@ impl EcdsaChannelSigner for TestChannelSigner {
389387
.unwrap();
390388
let countersignatory_htlc_key = HtlcKey::from_basepoint(
391389
&secp_ctx,
392-
&self.inner.counterparty_pubkeys().unwrap().htlc_basepoint,
390+
&channel_parameters.counterparty_pubkeys().unwrap().htlc_basepoint,
393391
&htlc_descriptor.per_commitment_point,
394392
);
395393

0 commit comments

Comments
 (0)