From aca3979a9e55738dad9a53e6aa9ab9bd52ded76a Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Thu, 28 Nov 2024 12:03:10 +0100 Subject: [PATCH] Take circular `GossipVerifier` reference by `Arc` Our current architecture requires `GossipVerifier`'s type signature to include a circular reference to itself. Previously, we directly gave that as `Self`, which however did not work when setting it dynamically under all circumstances. Here we take `Self` by `Arc` mitigate this issue. --- lightning-block-sync/src/gossip.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightning-block-sync/src/gossip.rs b/lightning-block-sync/src/gossip.rs index f075cf7b257..083156baab3 100644 --- a/lightning-block-sync/src/gossip.rs +++ b/lightning-block-sync/src/gossip.rs @@ -144,7 +144,7 @@ pub struct GossipVerifier< { source: Blocks, peer_manager_wake: Arc, - gossiper: Arc>, Self, L>>, + gossiper: Arc>, Arc, L>>, spawn: S, block_cache: Arc>>, } @@ -162,7 +162,7 @@ where /// This is expected to be given to a [`P2PGossipSync`] (initially constructed with `None` for /// the UTXO lookup) via [`P2PGossipSync::add_utxo_lookup`]. pub fn new( - source: Blocks, spawn: S, gossiper: Arc>, Self, L>>, + source: Blocks, spawn: S, gossiper: Arc>, Arc, L>>, peer_manager: APM, ) -> Self where