aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-06-11 06:30:20 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-06-11 06:30:20 +0800
commit979ebfc126d56263a1cbcd9c81f8a70aa4f60679 (patch)
tree8b1e23176c1e27827bc5e61b76bd0acadc978002 /cmd/geth
parent8482855bc75071a6cb386afb02fef9ffe1fb0d88 (diff)
parent3c1cccc801ec7c546a0d840fe3a08dbf9a302d2f (diff)
downloadgo-tangerine-979ebfc126d56263a1cbcd9c81f8a70aa4f60679.tar
go-tangerine-979ebfc126d56263a1cbcd9c81f8a70aa4f60679.tar.gz
go-tangerine-979ebfc126d56263a1cbcd9c81f8a70aa4f60679.tar.bz2
go-tangerine-979ebfc126d56263a1cbcd9c81f8a70aa4f60679.tar.lz
go-tangerine-979ebfc126d56263a1cbcd9c81f8a70aa4f60679.tar.xz
go-tangerine-979ebfc126d56263a1cbcd9c81f8a70aa4f60679.tar.zst
go-tangerine-979ebfc126d56263a1cbcd9c81f8a70aa4f60679.zip
Merge pull request #1224 from karalabe/report-import-progress
cmd/geth, eth/downloader: collect and report import progress too
Diffstat (limited to 'cmd/geth')
-rw-r--r--cmd/geth/admin.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/cmd/geth/admin.go b/cmd/geth/admin.go
index 13d10de32..4f22110ad 100644
--- a/cmd/geth/admin.go
+++ b/cmd/geth/admin.go
@@ -51,7 +51,7 @@ func (js *jsre) adminBindings() {
admin.Set("import", js.importChain)
admin.Set("export", js.exportChain)
admin.Set("verbosity", js.verbosity)
- admin.Set("progress", js.downloadProgress)
+ admin.Set("progress", js.syncProgress)
admin.Set("setSolc", js.setSolc)
admin.Set("contractInfo", struct{}{})
@@ -324,9 +324,14 @@ func (js *jsre) setHead(call otto.FunctionCall) otto.Value {
return otto.UndefinedValue()
}
-func (js *jsre) downloadProgress(call otto.FunctionCall) otto.Value {
- pending, cached := js.ethereum.Downloader().Stats()
- v, _ := call.Otto.ToValue(map[string]interface{}{"pending": pending, "cached": cached})
+func (js *jsre) syncProgress(call otto.FunctionCall) otto.Value {
+ pending, cached, importing, eta := js.ethereum.Downloader().Stats()
+ v, _ := call.Otto.ToValue(map[string]interface{}{
+ "pending": pending,
+ "cached": cached,
+ "importing": importing,
+ "estimate": (eta / time.Second * time.Second).String(),
+ })
return v
}