From: Arik Sosman Date: Fri, 13 Jan 2023 00:10:44 +0000 (-0800) Subject: Decouple lifetimes for trait implementations that used to comprise KeysInterface. X-Git-Tag: v0.0.114-beta~65^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=49c1f30c8cccba45057d01a942e5de883b18a8da;p=rust-lightning Decouple lifetimes for trait implementations that used to comprise KeysInterface. --- diff --git a/lightning/src/chain/channelmonitor.rs b/lightning/src/chain/channelmonitor.rs index efbda4af0..5434e7794 100644 --- a/lightning/src/chain/channelmonitor.rs +++ b/lightning/src/chain/channelmonitor.rs @@ -3704,9 +3704,9 @@ where const MAX_ALLOC_SIZE: usize = 64*1024; -impl<'a, ES: EntropySource, SP: SignerProvider> ReadableArgs<(&'a ES, &'a SP)> +impl<'a, 'b, ES: EntropySource, SP: SignerProvider> ReadableArgs<(&'a ES, &'b SP)> for (BlockHash, ChannelMonitor) { - fn read(reader: &mut R, args: (&'a ES, &'a SP)) -> Result { + fn read(reader: &mut R, args: (&'a ES, &'b SP)) -> Result { macro_rules! unwrap_obj { ($key: expr) => { match $key { diff --git a/lightning/src/chain/onchaintx.rs b/lightning/src/chain/onchaintx.rs index 78fae9a71..d6884428e 100644 --- a/lightning/src/chain/onchaintx.rs +++ b/lightning/src/chain/onchaintx.rs @@ -322,8 +322,8 @@ impl OnchainTxHandler { } } -impl<'a, ES: EntropySource, SP: SignerProvider> ReadableArgs<(&'a ES, &'a SP, u64, [u8; 32])> for OnchainTxHandler { - fn read(reader: &mut R, args: (&'a ES, &'a SP, u64, [u8; 32])) -> Result { +impl<'a, 'b, ES: EntropySource, SP: SignerProvider> ReadableArgs<(&'a ES, &'b SP, u64, [u8; 32])> for OnchainTxHandler { + fn read(reader: &mut R, args: (&'a ES, &'b SP, u64, [u8; 32])) -> Result { let entropy_source = args.0; let signer_provider = args.1; let channel_value_satoshis = args.2; diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index fdf7e7857..ff647990b 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -6331,12 +6331,12 @@ impl Writeable for Channel { } const MAX_ALLOC_SIZE: usize = 64*1024; -impl<'a, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'a SP, u32)> for Channel<::Signer> +impl<'a, 'b, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32)> for Channel<::Signer> where ES::Target: EntropySource, SP::Target: SignerProvider { - fn read(reader: &mut R, args: (&'a ES, &'a SP, u32)) -> Result { + fn read(reader: &mut R, args: (&'a ES, &'b SP, u32)) -> Result { let (entropy_source, signer_provider, serialized_height) = args; let ver = read_ver_prefix!(reader, SERIALIZATION_VERSION);