diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-02-11 02:20:59 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-02-11 02:20:59 +0800 |
commit | 1cc4bd76dbec6da4355a37cf68de808fcf0c95a3 (patch) | |
tree | 55f4c409ba14206bb94beda7f1fd49f880bff008 /eth/downloader/api.go | |
parent | be79b4aacb57d15ae73c376099ee1688d548b6b3 (diff) | |
parent | 59cd60b266ebec20e441b8508671a579630b9870 (diff) | |
download | dexon-1cc4bd76dbec6da4355a37cf68de808fcf0c95a3.tar dexon-1cc4bd76dbec6da4355a37cf68de808fcf0c95a3.tar.gz dexon-1cc4bd76dbec6da4355a37cf68de808fcf0c95a3.tar.bz2 dexon-1cc4bd76dbec6da4355a37cf68de808fcf0c95a3.tar.lz dexon-1cc4bd76dbec6da4355a37cf68de808fcf0c95a3.tar.xz dexon-1cc4bd76dbec6da4355a37cf68de808fcf0c95a3.tar.zst dexon-1cc4bd76dbec6da4355a37cf68de808fcf0c95a3.zip |
Merge pull request #2193 from karalabe/sync-state-reports
eth, eth/downloader, jsre: surface state sync progress through the API
Diffstat (limited to 'eth/downloader/api.go')
-rw-r--r-- | eth/downloader/api.go | 7 |
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 } |