Commit ddbf898b authored by Sergei Zubov's avatar Sergei Zubov

Modify newaddress request

Wallet saves to file after creating new address, and new address is
included in lookup
parent 9dcc87fe
...@@ -100,9 +100,15 @@ namespace Stratis.Bitcoin.Features.Wallet ...@@ -100,9 +100,15 @@ namespace Stratis.Bitcoin.Features.Wallet
{ {
Guard.NotNull(accountReference, nameof(accountReference)); Guard.NotNull(accountReference, nameof(accountReference));
return this.GetWalletByName(accountReference.WalletName) var wallet = this.GetWalletByName(accountReference.WalletName);
.GetAccountByCoinType(accountReference.AccountName, this.coinType).CreateAddresses(this.network, 1)
.Single(); var newAddress = wallet.GetAccountByCoinType(accountReference.AccountName, this.coinType)
.CreateAddresses(this.network, 1).Single();
this.UpdateKeysLookupLocked(new [] {newAddress});
this.SaveWallet(wallet);
return newAddress;
} }
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment