From aaefac0795a71533883d334ffc96d15a2d16189f Mon Sep 17 00:00:00 2001 From: tersec Date: Thu, 12 Sep 2024 16:42:38 +0000 Subject: [PATCH] key eth_syncing off correct indication, not peer count (#2619) --- nimbus/rpc/p2p.nim | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/nimbus/rpc/p2p.nim b/nimbus/rpc/p2p.nim index ef6aba885..b8c80f9c4 100644 --- a/nimbus/rpc/p2p.nim +++ b/nimbus/rpc/p2p.nim @@ -100,18 +100,15 @@ proc setupEthRpc*( server.rpc("eth_syncing") do() -> SyncingStatus: ## Returns SyncObject or false when not syncing. - # TODO: make sure we are not syncing - # when we reach the recent block - let numPeers = node.peerPool.connectedNodes.len - if numPeers > 0: - var sync = SyncObject( + if com.syncState != Waiting: + let sync = SyncObject( startingBlock: w3Qty com.syncStart, currentBlock : w3Qty com.syncCurrent, highestBlock : w3Qty com.syncHighest ) - result = SyncingStatus(syncing: true, syncObject: sync) + return SyncingStatus(syncing: true, syncObject: sync) else: - result = SyncingStatus(syncing: false) + return SyncingStatus(syncing: false) server.rpc("eth_coinbase") do() -> Web3Address: ## Returns the current coinbase address.