mirror of
https://github.com/LBRYFoundation/lbcwallet.git
synced 2025-08-23 17:47:29 +00:00
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) {
|
func getAccountAddress(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
|
||||||
cmd := icmd.(*btcjson.GetAccountAddressCmd)
|
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)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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
|
// getUnconfirmedBalance handles a getunconfirmedbalance extension request
|
||||||
|
|
Loading…
Add table
Reference in a new issue