From 94dbde8174d33bde4202e40c1bc21fe8d4b514f3 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 26 Oct 2022 21:55:23 +0000 Subject: [PATCH 1/2] Export io::ErrorKind in bindings The bindings have exported `io::Error` as, basically, `io::ErrorKind`, for quite some time, so there's little reason to not just export `io::ErrorKind` as well. --- lightning/src/ln/msgs.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lightning/src/ln/msgs.rs b/lightning/src/ln/msgs.rs index 58339339511..8b5a6ac6fd2 100644 --- a/lightning/src/ln/msgs.rs +++ b/lightning/src/ln/msgs.rs @@ -66,8 +66,7 @@ pub enum DecodeError { /// A length descriptor in the packet didn't describe the later data correctly BadLengthDescriptor, /// Error from std::io - Io(/// (C-not exported) as ErrorKind doesn't have a reasonable mapping - io::ErrorKind), + Io(io::ErrorKind), /// The message included zlib-compressed values, which we don't support. UnsupportedCompression, } From 17082ec7d8b47b2680b9d1f21f941f1aa58b605c Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 26 Oct 2022 20:46:34 +0000 Subject: [PATCH 2/2] Drop useless `mut` in `KeysInterface::sign_holder_anchor_input` The `Transaction` is not modified so there's no reason to make the reference `mut` --- lightning/src/chain/keysinterface.rs | 4 ++-- lightning/src/util/enforcing_trait_impls.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lightning/src/chain/keysinterface.rs b/lightning/src/chain/keysinterface.rs index e3108fd54da..b12eee017aa 100644 --- a/lightning/src/chain/keysinterface.rs +++ b/lightning/src/chain/keysinterface.rs @@ -352,7 +352,7 @@ pub trait BaseSign { /// Computes the signature for a commitment transaction's anchor output used as an /// input within `anchor_tx`, which spends the commitment transaction, at index `input`. fn sign_holder_anchor_input( - &self, anchor_tx: &mut Transaction, input: usize, secp_ctx: &Secp256k1, + &self, anchor_tx: &Transaction, input: usize, secp_ctx: &Secp256k1, ) -> Result; /// Signs a channel announcement message with our funding key and our node secret key (aka @@ -790,7 +790,7 @@ impl BaseSign for InMemorySigner { } fn sign_holder_anchor_input( - &self, anchor_tx: &mut Transaction, input: usize, secp_ctx: &Secp256k1, + &self, anchor_tx: &Transaction, input: usize, secp_ctx: &Secp256k1, ) -> Result { let witness_script = chan_utils::get_anchor_redeemscript(&self.holder_channel_pubkeys.funding_pubkey); let sighash = sighash::SighashCache::new(&*anchor_tx).segwit_signature_hash( diff --git a/lightning/src/util/enforcing_trait_impls.rs b/lightning/src/util/enforcing_trait_impls.rs index 8344f9f357f..6317b43d5ed 100644 --- a/lightning/src/util/enforcing_trait_impls.rs +++ b/lightning/src/util/enforcing_trait_impls.rs @@ -201,7 +201,7 @@ impl BaseSign for EnforcingSigner { } fn sign_holder_anchor_input( - &self, anchor_tx: &mut Transaction, input: usize, secp_ctx: &Secp256k1, + &self, anchor_tx: &Transaction, input: usize, secp_ctx: &Secp256k1, ) -> Result { debug_assert!(MIN_CHAN_DUST_LIMIT_SATOSHIS > ANCHOR_OUTPUT_VALUE_SATOSHI); // As long as our minimum dust limit is enforced and is greater than our anchor output