cmd/geth: expand admin.progress() to something meaningful

This commit is contained in:
Péter Szilágyi 2015-05-27 16:46:46 +03:00
parent 8951a03db3
commit 3f91ee4ff8
1 changed files with 2 additions and 2 deletions

View File

@ -262,8 +262,8 @@ func (js *jsre) setHead(call otto.FunctionCall) otto.Value {
}
func (js *jsre) downloadProgress(call otto.FunctionCall) otto.Value {
current, max := js.ethereum.Downloader().Stats()
v, _ := call.Otto.ToValue(fmt.Sprintf("%d/%d", current, max))
pending, cached := js.ethereum.Downloader().Stats()
v, _ := call.Otto.ToValue(map[string]interface{}{"pending": pending, "cached": cached})
return v
}