Skip to content

Commit

Permalink
key eth_syncing off correct indication, not peer count (#2619)
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec authored Sep 12, 2024
1 parent 178d77a commit aaefac0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions nimbus/rpc/p2p.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit aaefac0

Please sign in to comment.