multi-account: update getaccountaddress
This commit is contained in:
parent
6a610a8cdf
commit
71f8ba68a0
1 changed files with 12 additions and 6 deletions
|
@ -715,16 +715,22 @@ func getAccount(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
|
|||
func getAccountAddress(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
|
||||
cmd := icmd.(*btcjson.GetAccountAddressCmd)
|
||||
|
||||
account, err := w.AccountNumber(waddrmgr.KeyScopeBIP0044, cmd.Account)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
addr, err := w.CurrentAddress(account, waddrmgr.KeyScopeBIP0044)
|
||||
account, err := w.AccountNumber(*cmd.Account)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return addr.EncodeAddress(), err
|
||||
scope, err := lookupKeyScope(cmd.AddressType)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
addr, err := w.CurrentAddress(account, *scope)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return addr.EncodeAddress(), nil
|
||||
}
|
||||
|
||||
// getUnconfirmedBalance handles a getunconfirmedbalance extension request
|
||||
|
|
Loading…
Add table
Reference in a new issue