Skip to content

Commit 0428302

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

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lightning/src/sign/mod.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,13 +1224,12 @@ impl InMemorySigner {
12241224
return Err(());
12251225
}
12261226

1227-
let remotepubkey = bitcoin::PublicKey::new(self.pubkeys().payment_point);
1228-
// We cannot always assume that `channel_parameters` is set, so can't just call
1229-
// `self.channel_parameters()` or anything that relies on it
1230-
let supports_anchors_zero_fee_htlc_tx = self
1231-
.channel_type_features()
1232-
.map(|features| features.supports_anchors_zero_fee_htlc_tx())
1233-
.unwrap_or(false);
1227+
// TODO: Is this ok?
1228+
let channel_parameters =
1229+
descriptor.channel_transaction_parameters.as_ref().expect(MISSING_PARAMS_ERR);
1230+
let remotepubkey = bitcoin::PublicKey::new(channel_parameters.holder_pubkeys.payment_point);
1231+
let supports_anchors_zero_fee_htlc_tx =
1232+
channel_parameters.channel_type_features.supports_anchors_zero_fee_htlc_tx();
12341233

12351234
let witness_script = if supports_anchors_zero_fee_htlc_tx {
12361235
chan_utils::get_to_countersignatory_with_anchors_redeemscript(&remotepubkey.inner)

0 commit comments

Comments
 (0)