aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth/js.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/geth/js.go')
-rw-r--r--cmd/geth/js.go9
1 files changed, 9 insertions, 0 deletions
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
}