aboutsummaryrefslogtreecommitdiffstats
path: root/internal/ethapi
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-09-06 18:59:41 +0800
committerGitHub <noreply@github.com>2016-09-06 18:59:41 +0800
commit6fb8ae2bd6eb2b28f9b44799a8299183d634be80 (patch)
tree8ff6bb9a21870f6b26d2887ad82949a923d0d4df /internal/ethapi
parenteac390f28955d66f9152102058e0d85d972bc033 (diff)
parent2924fdfcf7ab67a66a4ed3fb95cb9140be0cc809 (diff)
downloaddexon-6fb8ae2bd6eb2b28f9b44799a8299183d634be80.tar
dexon-6fb8ae2bd6eb2b28f9b44799a8299183d634be80.tar.gz
dexon-6fb8ae2bd6eb2b28f9b44799a8299183d634be80.tar.bz2
dexon-6fb8ae2bd6eb2b28f9b44799a8299183d634be80.tar.lz
dexon-6fb8ae2bd6eb2b28f9b44799a8299183d634be80.tar.xz
dexon-6fb8ae2bd6eb2b28f9b44799a8299183d634be80.tar.zst
dexon-6fb8ae2bd6eb2b28f9b44799a8299183d634be80.zip
Merge pull request #2979 from karalabe/ethclient-sync-api
ethereum, ethclient: add SyncProgress API endpoint
Diffstat (limited to 'internal/ethapi')
-rw-r--r--internal/ethapi/api.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go
index 0fba55ae8..0b1384f58 100644
--- a/internal/ethapi/api.go
+++ b/internal/ethapi/api.go
@@ -73,19 +73,19 @@ func (s *PublicEthereumAPI) ProtocolVersion() *rpc.HexNumber {
// - pulledStates: number of state entries processed until now
// - knownStates: number of known state entries that still need to be pulled
func (s *PublicEthereumAPI) Syncing() (interface{}, error) {
- origin, current, height, pulled, known := s.b.Downloader().Progress()
+ progress := s.b.Downloader().Progress()
// Return not syncing if the synchronisation already completed
- if current >= height {
+ if progress.CurrentBlock >= progress.HighestBlock {
return false, nil
}
// Otherwise gather the block sync stats
return map[string]interface{}{
- "startingBlock": rpc.NewHexNumber(origin),
- "currentBlock": rpc.NewHexNumber(current),
- "highestBlock": rpc.NewHexNumber(height),
- "pulledStates": rpc.NewHexNumber(pulled),
- "knownStates": rpc.NewHexNumber(known),
+ "startingBlock": rpc.NewHexNumber(progress.StartingBlock),
+ "currentBlock": rpc.NewHexNumber(progress.CurrentBlock),
+ "highestBlock": rpc.NewHexNumber(progress.HighestBlock),
+ "pulledStates": rpc.NewHexNumber(progress.PulledStates),
+ "knownStates": rpc.NewHexNumber(progress.KnownStates),
}, nil
}