diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-20 03:45:58 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-20 03:46:19 +0800 |
commit | 5dd56bb474e9001db6decb75b7abfca99050d844 (patch) | |
tree | 3a4e323d0941f4c2d4f7ae17f3d8385867a837ff /cmd | |
parent | 2c1a6a349b4f8bb23e37a75d8d8ceaa0fbfced8d (diff) | |
download | dexon-5dd56bb474e9001db6decb75b7abfca99050d844.tar dexon-5dd56bb474e9001db6decb75b7abfca99050d844.tar.gz dexon-5dd56bb474e9001db6decb75b7abfca99050d844.tar.bz2 dexon-5dd56bb474e9001db6decb75b7abfca99050d844.tar.lz dexon-5dd56bb474e9001db6decb75b7abfca99050d844.tar.xz dexon-5dd56bb474e9001db6decb75b7abfca99050d844.tar.zst dexon-5dd56bb474e9001db6decb75b7abfca99050d844.zip |
geth: admin download status
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/geth/admin.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/geth/admin.go b/cmd/geth/admin.go index 2ac155e33..c42e91615 100644 --- a/cmd/geth/admin.go +++ b/cmd/geth/admin.go @@ -34,6 +34,7 @@ func (js *jsre) adminBindings() { admin.Set("export", js.exportChain) admin.Set("verbosity", js.verbosity) admin.Set("backtrace", js.backtrace) + admin.Set("progress", js.downloadProgress) admin.Set("miner", struct{}{}) t, _ = admin.Get("miner") @@ -51,6 +52,12 @@ func (js *jsre) adminBindings() { debug.Set("getBlockRlp", js.getBlockRlp) } +func (js *jsre) downloadProgress(call otto.FunctionCall) otto.Value { + current, max := js.ethereum.Downloader().Stats() + + return js.re.ToVal(fmt.Sprintf("%d/%d", current, max)) +} + func (js *jsre) getBlockRlp(call otto.FunctionCall) otto.Value { var block *types.Block if len(call.ArgumentList) > 0 { |