Skip to content

Commit d7df800

Browse files
committed
Pass channel params to sign_splicing_funding_input
Now that channel_value_satoshis has been moved to ChannelTransactionParameters, pass the entire parameters when calling each method on EcdsaChannelSigner. This will remove the need for ChannelSigner::provide_channel_parameters. Instead, the parameters from the FundingScope will be passed in to each method. This simplifies the interaction with a ChannelSigner when needing to be called for more than one FundingScope, which will be the case for pending splices and RBF attempts.
1 parent 6d9ec87 commit d7df800

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

lightning/src/sign/ecdsa.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ pub trait EcdsaChannelSigner: ChannelSigner {
254254
/// This method is *not* asynchronous. If an `Err` is returned, the channel will be immediately
255255
/// closed.
256256
fn sign_splicing_funding_input(
257-
&self, tx: &Transaction, input_index: usize, input_value: u64,
258-
secp_ctx: &Secp256k1<secp256k1::All>,
257+
&self, channel_parameters: &ChannelTransactionParameters, tx: &Transaction,
258+
input_index: usize, input_value: u64, secp_ctx: &Secp256k1<secp256k1::All>,
259259
) -> Result<Signature, ()>;
260260
}

lightning/src/sign/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,12 +1704,12 @@ impl EcdsaChannelSigner for InMemorySigner {
17041704
}
17051705

17061706
fn sign_splicing_funding_input(
1707-
&self, tx: &Transaction, input_index: usize, input_value: u64,
1708-
secp_ctx: &Secp256k1<secp256k1::All>,
1707+
&self, channel_parameters: &ChannelTransactionParameters, tx: &Transaction,
1708+
input_index: usize, input_value: u64, secp_ctx: &Secp256k1<secp256k1::All>,
17091709
) -> Result<Signature, ()> {
17101710
let funding_pubkey = PublicKey::from_secret_key(secp_ctx, &self.funding_key);
17111711
let counterparty_funding_key =
1712-
&self.counterparty_pubkeys().expect(MISSING_PARAMS_ERR).funding_pubkey;
1712+
&channel_parameters.counterparty_pubkeys().expect(MISSING_PARAMS_ERR).funding_pubkey;
17131713
let funding_redeemscript =
17141714
make_funding_redeemscript(&funding_pubkey, counterparty_funding_key);
17151715
let sighash = &sighash::SighashCache::new(tx)

lightning/src/util/test_channel_signer.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,10 +480,16 @@ impl EcdsaChannelSigner for TestChannelSigner {
480480
}
481481

482482
fn sign_splicing_funding_input(
483-
&self, tx: &Transaction, input_index: usize, input_value: u64,
484-
secp_ctx: &Secp256k1<secp256k1::All>,
483+
&self, channel_parameters: &ChannelTransactionParameters, tx: &Transaction,
484+
input_index: usize, input_value: u64, secp_ctx: &Secp256k1<secp256k1::All>,
485485
) -> Result<Signature, ()> {
486-
self.inner.sign_splicing_funding_input(tx, input_index, input_value, secp_ctx)
486+
self.inner.sign_splicing_funding_input(
487+
channel_parameters,
488+
tx,
489+
input_index,
490+
input_value,
491+
secp_ctx,
492+
)
487493
}
488494
}
489495

0 commit comments

Comments
 (0)