diff --git a/cmd/geth/consolecmd_test.go b/cmd/geth/consolecmd_test.go index 14fe578a8f..3a1c24c3ff 100644 --- a/cmd/geth/consolecmd_test.go +++ b/cmd/geth/consolecmd_test.go @@ -139,7 +139,9 @@ func testAttachWelcome(t *testing.T, geth *testgeth, endpoint, apis string) { attach.SetTemplateFunc("gover", runtime.Version) attach.SetTemplateFunc("gethver", func() string { return params.VersionWithCommit("", "") }) attach.SetTemplateFunc("etherbase", func() string { return geth.Etherbase }) - attach.SetTemplateFunc("niltime", func() string { return time.Unix(0, 0).Format(time.RFC1123) }) + attach.SetTemplateFunc("niltime", func() string { + return time.Unix(0, 0).Format("Mon Jan 02 2006 15:04:05 GMT-0700 (MST)") + }) attach.SetTemplateFunc("ipc", func() bool { return strings.HasPrefix(endpoint, "ipc") }) attach.SetTemplateFunc("datadir", func() string { return geth.Datadir }) attach.SetTemplateFunc("apis", func() string { return apis }) diff --git a/console/console.go b/console/console.go index 6f3e6a963f..834c29ee73 100644 --- a/console/console.go +++ b/console/console.go @@ -206,14 +206,14 @@ func (c *Console) init(preload []string) error { } } // The admin.sleep and admin.sleepBlocks are offered by the console and not by the RPC layer. - admin := c.jsre.Get("admin") - if admin == nil { - return fmt.Errorf("could not find admin") - } - if obj := admin.ToObject(c.runtime); obj != nil { // make sure the admin api is enabled over the interface - obj.Set("sleepBlocks", bridge.SleepBlocks) - obj.Set("sleep", bridge.Sleep) - obj.Set("clearHistory", c.clearHistory) + admin := c.jsre.Get("admin") // Could be `nil` + if admin != nil { + // make sure the admin api is enabled over the interface + if obj := admin.ToObject(c.runtime); obj != nil { + obj.Set("sleepBlocks", bridge.SleepBlocks) + obj.Set("sleep", bridge.Sleep) + obj.Set("clearHistory", c.clearHistory) + } } // Preload any JavaScript files before starting the console for _, path := range preload {