From acb4819ee132dd09c2c9807dda3bbfe347be2235 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Wed, 26 Feb 2014 13:56:31 -0500 Subject: [PATCH] Allocate and init transaction store for newly created accounts. --- acctmgr.go | 3 ++- cmd.go | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/acctmgr.go b/acctmgr.go index 387dd73..ace8165 100644 --- a/acctmgr.go +++ b/acctmgr.go @@ -285,7 +285,8 @@ func (am *AccountManager) CreateEncryptedWallet(passphrase []byte) error { // manager. Registering will fail if the new account can not be // written immediately to disk. a := &Account{ - Wallet: wlt, + Wallet: wlt, + TxStore: tx.NewStore(), } if err := am.RegisterNewAccount(a); err != nil { return err diff --git a/cmd.go b/cmd.go index c700b7c..0725d80 100644 --- a/cmd.go +++ b/cmd.go @@ -261,7 +261,9 @@ func (e *WalletOpenError) Error() string { func OpenSavedAccount(name string, cfg *config) (*Account, error) { netdir := networkDir(cfg.Net()) if err := checkCreateDir(netdir); err != nil { - return nil, err + return nil, &WalletOpenError{ + Err: err.Error(), + } } wlt := new(wallet.Wallet)