From fc2e33c594449e38b90bad2bd7b5c50f03b7f69d Mon Sep 17 00:00:00 2001 From: zelig Date: Thu, 18 Jun 2015 16:20:00 +0100 Subject: unlock multiple passes and obsolete primary * multiple passwords allowed in password file * split on "\n", sideeffect: chop trailing slashes. fixes common mistake <(echo 'pass') * remove accounts.Primary method * do not fall back to primary account for mining --- accounts/account_manager.go | 13 ------------- accounts/accounts_test.go | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) (limited to 'accounts') diff --git a/accounts/account_manager.go b/accounts/account_manager.go index e79ec51a2..4519c8420 100644 --- a/accounts/account_manager.go +++ b/accounts/account_manager.go @@ -81,19 +81,6 @@ func (am *Manager) HasAccount(addr common.Address) bool { return false } -func (am *Manager) Primary() (addr common.Address, err error) { - addrs, err := am.keyStore.GetKeyAddresses() - if os.IsNotExist(err) { - return common.Address{}, ErrNoKeys - } else if err != nil { - return common.Address{}, err - } - if len(addrs) == 0 { - return common.Address{}, ErrNoKeys - } - return addrs[0], nil -} - func (am *Manager) DeleteAccount(address common.Address, auth string) error { return am.keyStore.DeleteKey(address, auth) } diff --git a/accounts/accounts_test.go b/accounts/accounts_test.go index 6065fa8e4..8bd70880c 100644 --- a/accounts/accounts_test.go +++ b/accounts/accounts_test.go @@ -18,7 +18,7 @@ func TestSign(t *testing.T) { pass := "" // not used but required by API a1, err := am.NewAccount(pass) toSign := randentropy.GetEntropyCSPRNG(32) - am.Unlock(a1.Address, "", 0) + am.Unlock(a1.Address, "") _, err = am.Sign(a1, toSign) if err != nil { -- cgit v1.2.3