From 21e52efdfed19c4376b830f8ad0e52a9e599f633 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 11 May 2015 15:43:14 +0200 Subject: cmd/geth, miner, backend, xeth: Fixed miner threads to be settable Miner threads are now settable through the admin interface (closes #897) and specify 0 CPU worker threads when eth_getWork is called (closes #916) --- cmd/geth/admin.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'cmd/geth/admin.go') diff --git a/cmd/geth/admin.go b/cmd/geth/admin.go index 2b9956638..17d711297 100644 --- a/cmd/geth/admin.go +++ b/cmd/geth/admin.go @@ -275,14 +275,13 @@ func (js *jsre) verbosity(call otto.FunctionCall) otto.Value { } func (js *jsre) startMining(call otto.FunctionCall) otto.Value { - _, err := call.Argument(0).ToInteger() + threads, err := call.Argument(0).ToInteger() if err != nil { fmt.Println(err) return otto.FalseValue() } - // threads now ignored - err = js.ethereum.StartMining() + err = js.ethereum.StartMining(int(threads)) if err != nil { fmt.Println(err) return otto.FalseValue() -- cgit v1.2.3 From 97dd4551ef757c33fa33b5c06a0b15582e6a8af3 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 11 May 2015 21:47:34 +0200 Subject: miner, cmd/geth: miner will not ignored owned account transactions Miner does not ignore low gas txs from accounts that are owned. --- cmd/geth/admin.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'cmd/geth/admin.go') diff --git a/cmd/geth/admin.go b/cmd/geth/admin.go index 17d711297..b0cb7507a 100644 --- a/cmd/geth/admin.go +++ b/cmd/geth/admin.go @@ -275,10 +275,19 @@ func (js *jsre) verbosity(call otto.FunctionCall) otto.Value { } func (js *jsre) startMining(call otto.FunctionCall) otto.Value { - threads, err := call.Argument(0).ToInteger() - if err != nil { - fmt.Println(err) - return otto.FalseValue() + var ( + threads int64 + err error + ) + + if len(call.ArgumentList) > 0 { + threads, err = call.Argument(0).ToInteger() + if err != nil { + fmt.Println(err) + return otto.FalseValue() + } + } else { + threads = 4 } err = js.ethereum.StartMining(int(threads)) -- cgit v1.2.3 From da9fe951da4005761a014316c46771d628dc058e Mon Sep 17 00:00:00 2001 From: Gustav Simonsson Date: Thu, 2 Apr 2015 21:14:25 +0200 Subject: Use common.Address type for accounts.Address --- cmd/geth/admin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd/geth/admin.go') diff --git a/cmd/geth/admin.go b/cmd/geth/admin.go index b0cb7507a..949a7bde0 100644 --- a/cmd/geth/admin.go +++ b/cmd/geth/admin.go @@ -391,7 +391,7 @@ func (js *jsre) unlock(call otto.FunctionCall) otto.Value { } } am := js.ethereum.AccountManager() - err = am.TimedUnlock(common.FromHex(addr), passphrase, time.Duration(seconds)*time.Second) + err = am.TimedUnlock(common.HexToAddress(addr), passphrase, time.Duration(seconds)*time.Second) if err != nil { fmt.Printf("Unlock account failed '%v'\n", err) return otto.FalseValue() @@ -433,7 +433,7 @@ func (js *jsre) newAccount(call otto.FunctionCall) otto.Value { fmt.Printf("Could not create the account: %v", err) return otto.UndefinedValue() } - return js.re.ToVal(common.ToHex(acct.Address)) + return js.re.ToVal(acct.Address.Hex()) } func (js *jsre) nodeInfo(call otto.FunctionCall) otto.Value { -- cgit v1.2.3 From 2c1b0ff17e020f300ed9d5a5a244f59b4febfe66 Mon Sep 17 00:00:00 2001 From: Gustav Simonsson Date: Sun, 10 May 2015 20:30:02 +0200 Subject: Update key store to new spec but keep address field for now * Also fix address types post-rebase --- cmd/geth/admin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/geth/admin.go') diff --git a/cmd/geth/admin.go b/cmd/geth/admin.go index 949a7bde0..15923c366 100644 --- a/cmd/geth/admin.go +++ b/cmd/geth/admin.go @@ -126,7 +126,7 @@ func (js *jsre) pendingTransactions(call otto.FunctionCall) otto.Value { // Add the accouns to a new set accountSet := set.New() for _, account := range accounts { - accountSet.Add(common.BytesToAddress(account.Address)) + accountSet.Add(account.Address) } //ltxs := make([]*tx, len(txs)) -- cgit v1.2.3