From 7181cc4e26fee7608b97cdb0a806d9217069146f Mon Sep 17 00:00:00 2001 From: viraladmin <00purple@gmail.com> Date: Fri, 12 Jun 2026 10:49:34 -0600 Subject: [PATCH] handshake process --- src/rpc/client/handshake_processing.rs | 4 ++++ src/rpc/server/handshake.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/rpc/client/handshake_processing.rs b/src/rpc/client/handshake_processing.rs index 531db61..c5a6892 100644 --- a/src/rpc/client/handshake_processing.rs +++ b/src/rpc/client/handshake_processing.rs @@ -191,6 +191,10 @@ pub async fn bootstrap_peer_discovery(mut params: BootstrapParams) -> Result<(), let post_sync_remote_height = request_remote_height(stream.clone(), params.map.clone(), current_key.clone()).await?; + if let Err(err) = NodeInfo::rebuild_mined_counts_from_chain(¶ms.db).await { + error!("[startup] failed to rebuild mined counts before startup orphan check: {err}"); + } + let imported_candidates = match hydrate_torrent_candidates(stream.clone(), params.map.clone(), current_key.clone()) .await diff --git a/src/rpc/server/handshake.rs b/src/rpc/server/handshake.rs index 853343c..ad67b09 100644 --- a/src/rpc/server/handshake.rs +++ b/src/rpc/server/handshake.rs @@ -99,6 +99,10 @@ async fn sync_incoming_peer_before_operational( let post_sync_remote_height = request_remote_height(stream.clone(), map.clone(), connections_key.to_string()).await?; + if let Err(err) = NodeInfo::rebuild_mined_counts_from_chain(db).await { + error!("[startup] failed to rebuild mined counts before incoming orphan check: {err}"); + } + let imported_candidates = match hydrate_torrent_candidates( stream.clone(), map.clone(),