From cdd34fcb166cdb90ee411d029e6851325e80c8d3 Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Tue, 19 Jan 2016 09:26:17 +0100 Subject: console: add admin.sleep and admin.sleepBlocks --- cmd/geth/js.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cmd/geth/js.go') diff --git a/cmd/geth/js.go b/cmd/geth/js.go index 9329eaa0e..cdafab7fa 100644 --- a/cmd/geth/js.go +++ b/cmd/geth/js.go @@ -348,6 +348,15 @@ func (js *jsre) apiBindings(f xeth.Frontend) error { persObj.Set("newAccount", jeth.NewAccount) } + // The admin.sleep and admin.sleepBlocks are offered by the console and not by the RPC layer. + // Bind these if the admin module is available. + if a, err := js.re.Get("admin"); err == nil { + if adminObj := a.Object(); adminObj != nil { + adminObj.Set("sleepBlocks", jeth.SleepBlocks) + adminObj.Set("sleep", jeth.Sleep) + } + } + return nil } -- cgit v1.2.3