Skip to content

Commit

Permalink
multi-account: update getaccountaddress
Browse files Browse the repository at this point in the history
  • Loading branch information
roylee17 committed Sep 28, 2022
1 parent 6a610a8 commit 71f8ba6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions rpc/legacyrpc/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
account, err := w.AccountNumber(*cmd.Account)
if err != nil {
return nil, err
}
addr, err := w.CurrentAddress(account, waddrmgr.KeyScopeBIP0044)

scope, err := lookupKeyScope(cmd.AddressType)
if err != nil {
return nil, err
}

return addr.EncodeAddress(), err
addr, err := w.CurrentAddress(account, *scope)
if err != nil {
return nil, err
}

return addr.EncodeAddress(), nil
}

// getUnconfirmedBalance handles a getunconfirmedbalance extension request
Expand Down

0 comments on commit 71f8ba6

Please sign in to comment.