cmd/geth, eth/downloader: rough guess at the import eta

This commit is contained in:
Péter Szilágyi
2015-06-10 18:01:05 +03:00
parent b3d5ce7d48
commit 271fb20ecb
2 changed files with 20 additions and 4 deletions

View File

@ -325,8 +325,13 @@ func (js *jsre) setHead(call otto.FunctionCall) otto.Value {
}
func (js *jsre) syncProgress(call otto.FunctionCall) otto.Value {
pending, cached, importing := js.ethereum.Downloader().Stats()
v, _ := call.Otto.ToValue(map[string]interface{}{"pending": pending, "cached": cached, "importing": importing})
pending, cached, importing, eta := js.ethereum.Downloader().Stats()
v, _ := call.Otto.ToValue(map[string]interface{}{
"pending": pending,
"cached": cached,
"importing": importing,
"estimate": eta.String(),
})
return v
}