Merge pull request #2753 from TheBlueMatt/2023-11-inbound-preimages
[rust-lightning] / lightning / src / sign / mod.rs
index 5a80cb2318adb22c3e297a9c27238c8041eaf72a..4e418f049bbc9867a7a2a7920706e17c135ed23e 100644 (file)
@@ -594,14 +594,14 @@ pub trait ChannelSigner {
        /// Policy checks should be implemented in this function, including checking the amount
        /// sent to us and checking the HTLCs.
        ///
-       /// The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
+       /// The preimages of outbound HTLCs that were fulfilled since the last commitment are provided.
        /// A validating signer should ensure that an HTLC output is removed only when the matching
        /// preimage is provided, or when the value to holder is restored.
        ///
        /// Note that all the relevant preimages will be provided, but there may also be additional
        /// irrelevant or duplicate preimages.
        fn validate_holder_commitment(&self, holder_tx: &HolderCommitmentTransaction,
-               preimages: Vec<PaymentPreimage>) -> Result<(), ()>;
+               outbound_htlc_preimages: Vec<PaymentPreimage>) -> Result<(), ()>;
 
        /// Validate the counterparty's revocation.
        ///
@@ -1086,7 +1086,7 @@ impl ChannelSigner for InMemorySigner {
                chan_utils::build_commitment_secret(&self.commitment_seed, idx)
        }
 
-       fn validate_holder_commitment(&self, _holder_tx: &HolderCommitmentTransaction, _preimages: Vec<PaymentPreimage>) -> Result<(), ()> {
+       fn validate_holder_commitment(&self, _holder_tx: &HolderCommitmentTransaction, _outbound_htlc_preimages: Vec<PaymentPreimage>) -> Result<(), ()> {
                Ok(())
        }
 
@@ -1112,7 +1112,7 @@ impl ChannelSigner for InMemorySigner {
 const MISSING_PARAMS_ERR: &'static str = "ChannelSigner::provide_channel_parameters must be called before signing operations";
 
 impl EcdsaChannelSigner for InMemorySigner {
-       fn sign_counterparty_commitment(&self, commitment_tx: &CommitmentTransaction, _preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<secp256k1::All>) -> Result<(Signature, Vec<Signature>), ()> {
+       fn sign_counterparty_commitment(&self, commitment_tx: &CommitmentTransaction, _inbound_htlc_preimages: Vec<PaymentPreimage>, _outbound_htlc_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<secp256k1::All>) -> Result<(Signature, Vec<Signature>), ()> {
                let trusted_tx = commitment_tx.trust();
                let keys = trusted_tx.keys();
 
@@ -1260,7 +1260,7 @@ impl TaprootChannelSigner for InMemorySigner {
                todo!()
        }
 
-       fn partially_sign_counterparty_commitment(&self, counterparty_nonce: PublicNonce, commitment_tx: &CommitmentTransaction, preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<All>) -> Result<(PartialSignatureWithNonce, Vec<schnorr::Signature>), ()> {
+       fn partially_sign_counterparty_commitment(&self, counterparty_nonce: PublicNonce, commitment_tx: &CommitmentTransaction, inbound_htlc_preimages: Vec<PaymentPreimage>, outbound_htlc_preimages: Vec<PaymentPreimage>, secp_ctx: &Secp256k1<All>) -> Result<(PartialSignatureWithNonce, Vec<schnorr::Signature>), ()> {
                todo!()
        }