key eth_syncing off correct indication, not peer count (#2619)
This commit is contained in:
parent
178d77ab31
commit
aaefac0795
|
@ -100,18 +100,15 @@ proc setupEthRpc*(
|
||||||
|
|
||||||
server.rpc("eth_syncing") do() -> SyncingStatus:
|
server.rpc("eth_syncing") do() -> SyncingStatus:
|
||||||
## Returns SyncObject or false when not syncing.
|
## Returns SyncObject or false when not syncing.
|
||||||
# TODO: make sure we are not syncing
|
if com.syncState != Waiting:
|
||||||
# when we reach the recent block
|
let sync = SyncObject(
|
||||||
let numPeers = node.peerPool.connectedNodes.len
|
|
||||||
if numPeers > 0:
|
|
||||||
var sync = SyncObject(
|
|
||||||
startingBlock: w3Qty com.syncStart,
|
startingBlock: w3Qty com.syncStart,
|
||||||
currentBlock : w3Qty com.syncCurrent,
|
currentBlock : w3Qty com.syncCurrent,
|
||||||
highestBlock : w3Qty com.syncHighest
|
highestBlock : w3Qty com.syncHighest
|
||||||
)
|
)
|
||||||
result = SyncingStatus(syncing: true, syncObject: sync)
|
return SyncingStatus(syncing: true, syncObject: sync)
|
||||||
else:
|
else:
|
||||||
result = SyncingStatus(syncing: false)
|
return SyncingStatus(syncing: false)
|
||||||
|
|
||||||
server.rpc("eth_coinbase") do() -> Web3Address:
|
server.rpc("eth_coinbase") do() -> Web3Address:
|
||||||
## Returns the current coinbase address.
|
## Returns the current coinbase address.
|
||||||
|
|
Loading…
Reference in New Issue