diff options
Diffstat (limited to 'cmd/geth')
-rw-r--r-- | cmd/geth/admin.go | 7 | ||||
-rw-r--r-- | cmd/geth/js_test.go | 2 | ||||
-rw-r--r-- | cmd/geth/main.go | 9 |
3 files changed, 11 insertions, 7 deletions
diff --git a/cmd/geth/admin.go b/cmd/geth/admin.go index 15923c366..ebdf3512a 100644 --- a/cmd/geth/admin.go +++ b/cmd/geth/admin.go @@ -8,6 +8,7 @@ import ( "strconv" "time" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/compiler" @@ -287,7 +288,7 @@ func (js *jsre) startMining(call otto.FunctionCall) otto.Value { return otto.FalseValue() } } else { - threads = 4 + threads = int64(js.ethereum.MinerThreads) } err = js.ethereum.StartMining(int(threads)) @@ -374,6 +375,10 @@ func (js *jsre) unlock(call otto.FunctionCall) otto.Value { fmt.Println(err) return otto.FalseValue() } + if seconds == 0 { + seconds = accounts.DefaultAccountUnlockDuration + } + arg := call.Argument(1) var passphrase string if arg.IsUndefined() { diff --git a/cmd/geth/js_test.go b/cmd/geth/js_test.go index c2a0e2fe2..e02e8f704 100644 --- a/cmd/geth/js_test.go +++ b/cmd/geth/js_test.go @@ -68,7 +68,7 @@ func testJEthRE(t *testing.T) (string, *testjethre, *eth.Ethereum) { // set up mock genesis with balance on the testAddress core.GenesisData = []byte(testGenesis) - ks := crypto.NewKeyStorePassphrase(filepath.Join(tmp, "keystore")) + ks := crypto.NewKeyStorePlain(filepath.Join(tmp, "keystore")) am := accounts.NewManager(ks) ethereum, err := eth.New(ð.Config{ DataDir: tmp, diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 1582953f7..158b08796 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -50,7 +50,7 @@ import _ "net/http/pprof" const ( ClientIdentifier = "Geth" - Version = "0.9.20" + Version = "0.9.21" ) var ( @@ -283,8 +283,6 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso } func main() { - //fmt.Printf("\n π\n\n α΄‘α΄Κα΄α΄α΄α΄ α΄α΄ α΄Κα΄\n π
π π π π π π π\n\nπΎ π΅πΎπΎ π πΎ π΅ πΎ\n\n") - fmt.Println("\n Welcome to the\n FRONTIER\n") runtime.GOMAXPROCS(runtime.NumCPU()) defer logger.Flush() if err := app.Run(os.Args); err != nil { @@ -368,10 +366,11 @@ func unlockAccount(ctx *cli.Context, am *accounts.Manager, account string) (pass if len(account) == 0 { utils.Fatalf("Invalid account address '%s'", account) } - err = am.Unlock(common.StringToAddress(account), passphrase) + err = am.Unlock(common.HexToAddress(account), passphrase) if err != nil { utils.Fatalf("Unlock account failed '%v'", err) } + fmt.Printf("Account '%s' unlocked.\n", account) return } @@ -562,7 +561,7 @@ func upgradeDb(ctx *cli.Context) { bcVersion = core.BlockChainVersion } - filename := fmt.Sprintf("blockchain_%d_%s.chain", bcVersion, time.Now().Format("2006-01-02_15:04:05")) + filename := fmt.Sprintf("blockchain_%d_%s.chain", bcVersion, time.Now().Format("20060102_150405")) exportFile := filepath.Join(ctx.GlobalString(utils.DataDirFlag.Name), filename) err = utils.ExportChain(ethereum.ChainManager(), exportFile) |