aboutsummaryrefslogtreecommitdiffstats
path: root/eth/downloader/api.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-02-10 17:56:15 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-02-10 20:30:41 +0800
commit59cd60b266ebec20e441b8508671a579630b9870 (patch)
tree55f4c409ba14206bb94beda7f1fd49f880bff008 /eth/downloader/api.go
parentbe79b4aacb57d15ae73c376099ee1688d548b6b3 (diff)
downloadgo-tangerine-59cd60b266ebec20e441b8508671a579630b9870.tar
go-tangerine-59cd60b266ebec20e441b8508671a579630b9870.tar.gz
go-tangerine-59cd60b266ebec20e441b8508671a579630b9870.tar.bz2
go-tangerine-59cd60b266ebec20e441b8508671a579630b9870.tar.lz
go-tangerine-59cd60b266ebec20e441b8508671a579630b9870.tar.xz
go-tangerine-59cd60b266ebec20e441b8508671a579630b9870.tar.zst
go-tangerine-59cd60b266ebec20e441b8508671a579630b9870.zip
eth, eth/downloader, jsre: surface state sync progress through the API
Diffstat (limited to 'eth/downloader/api.go')
-rw-r--r--eth/downloader/api.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/eth/downloader/api.go b/eth/downloader/api.go
index cc79e669f..6df911fee 100644
--- a/eth/downloader/api.go
+++ b/eth/downloader/api.go
@@ -36,6 +36,8 @@ type Progress struct {
Origin uint64 `json:"startingBlock"`
Current uint64 `json:"currentBlock"`
Height uint64 `json:"highestBlock"`
+ Pulled uint64 `json:"pulledStates"`
+ Known uint64 `json:"knownStates"`
}
// SyncingResult provides information about the current synchronisation status for this node.
@@ -44,7 +46,7 @@ type SyncingResult struct {
Status Progress `json:"status"`
}
-// Syncing provides information when this nodes starts synchronising with the Ethereumn network and when it's finished.
+// Syncing provides information when this nodes starts synchronising with the Ethereum network and when it's finished.
func (s *PublicDownloaderAPI) Syncing() (rpc.Subscription, error) {
sub := s.d.mux.Subscribe(StartEvent{}, DoneEvent{}, FailedEvent{})
@@ -52,13 +54,12 @@ func (s *PublicDownloaderAPI) Syncing() (rpc.Subscription, error) {
switch event.(type) {
case StartEvent:
result := &SyncingResult{Syncing: true}
- result.Status.Origin, result.Status.Current, result.Status.Height = s.d.Progress()
+ result.Status.Origin, result.Status.Current, result.Status.Height, result.Status.Pulled, result.Status.Known = s.d.Progress()
return result
case DoneEvent, FailedEvent:
return false
}
return nil
}
-
return rpc.NewSubscriptionWithOutputFormat(sub, output), nil
}