Allocate and init transaction store for newly created accounts.

This commit is contained in:
Josh Rickmar 2014-02-26 13:56:31 -05:00
parent 6805d7a7a1
commit acb4819ee1
2 changed files with 5 additions and 2 deletions

View file

@ -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

4
cmd.go
View file

@ -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)