From 6482635ba6be94d73ea0c179bd5a09243c9b8f7a Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 30 Sep 2023 17:32:28 +0000 Subject: [PATCH] Fix `Simple*PeerManager` to not require refs to the `UtxoLookup` `UtxoLookup` doesn't strictly need to be referenced from the `PeerManager`, and in fact the new `GossipVerifier` in `lightning-block-sync` requires itself to be owned by the `PeerManager` (for circular type reasons). This allows us to use `lightning-block-sync`'s `GossipVerifier` with `SimpleArcPeerManager` in ldk-sample. --- lightning-background-processor/src/lib.rs | 2 +- lightning/src/ln/peer_handler.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lightning-background-processor/src/lib.rs b/lightning-background-processor/src/lib.rs index efa1a4214..4b13d893e 100644 --- a/lightning-background-processor/src/lib.rs +++ b/lightning-background-processor/src/lib.rs @@ -528,7 +528,7 @@ use core::task; /// # type MyFilter = dyn lightning::chain::Filter + Send + Sync; /// # type MyLogger = dyn lightning::util::logger::Logger + Send + Sync; /// # type MyChainMonitor = lightning::chain::chainmonitor::ChainMonitor, Arc, Arc, Arc, Arc>; -/// # type MyPeerManager = lightning::ln::peer_handler::SimpleArcPeerManager; +/// # type MyPeerManager = lightning::ln::peer_handler::SimpleArcPeerManager, MyLogger>; /// # type MyNetworkGraph = lightning::routing::gossip::NetworkGraph>; /// # type MyGossipSync = lightning::routing::gossip::P2PGossipSync, Arc, Arc>; /// # type MyChannelManager = lightning::ln::channelmanager::SimpleArcChannelManager; diff --git a/lightning/src/ln/peer_handler.rs b/lightning/src/ln/peer_handler.rs index 1e0294073..63dfa527d 100644 --- a/lightning/src/ln/peer_handler.rs +++ b/lightning/src/ln/peer_handler.rs @@ -611,7 +611,7 @@ impl Peer { pub type SimpleArcPeerManager = PeerManager< SD, Arc>, - Arc>>, Arc, Arc>>, + Arc>>, C, Arc>>, Arc>, Arc, IgnoringMessageHandler, @@ -627,12 +627,12 @@ pub type SimpleArcPeerManager = PeerManager< /// /// This is not exported to bindings users as general type aliases don't make sense in bindings. pub type SimpleRefPeerManager< - 'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, SD, M, T, F, C, L + 'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, SD, M, T, F, C, L > = PeerManager< SD, - &'n SimpleRefChannelManager<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'm, M, T, F, L>, - &'f P2PGossipSync<&'g NetworkGraph<&'f L>, &'h C, &'f L>, - &'i SimpleRefOnionMessenger<'g, 'm, 'n, L>, + &'j SimpleRefChannelManager<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'i, M, T, F, L>, + &'f P2PGossipSync<&'g NetworkGraph<&'f L>, C, &'f L>, + &'h SimpleRefOnionMessenger<'g, 'i, 'j, L>, &'f L, IgnoringMessageHandler, &'c KeysManager -- 2.39.5