diff options
Diffstat (limited to 'accounts')
-rw-r--r-- | accounts/account_manager.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/accounts/account_manager.go b/accounts/account_manager.go index 21ef46991..f063f8ca5 100644 --- a/accounts/account_manager.go +++ b/accounts/account_manager.go @@ -239,3 +239,15 @@ func (am *Manager) Import(path string, keyAuth string) (Account, error) { } return Account{Address: key.Address}, nil } + +func (am *Manager) ImportPreSaleKey(keyJSON []byte, password string) (acc Account, err error) { + var key *crypto.Key + key, err = crypto.ImportPreSaleKey(am.keyStore, keyJSON, password) + if err != nil { + return + } + if err = am.keyStore.StoreKey(key, password); err != nil { + return + } + return Account{Address: key.Address}, nil +} |