Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

listaccounts only checks balances for KeyScopeBIP0044 addresses #881

Open
1F47E opened this issue Jul 11, 2023 · 0 comments
Open

listaccounts only checks balances for KeyScopeBIP0044 addresses #881

1F47E opened this issue Jul 11, 2023 · 0 comments

Comments

@1F47E
Copy link

1F47E commented Jul 11, 2023

I noticed that the listaccounts command is using only the KeyScopeBIP0044 scope when returning a list of accounts and their balances. Given that there are multiple key scopes defined (i.e., KeyScopeBIP0049Plus, KeyScopeBIP0084),

I wonder if listaccounts command should check balances for all of these key types.

In the example below I have some balance on bech32 addresses and 0 in legacy.

btcctl --wallet listaccounts

{
  "default": 0,
}

Calculated not correctly via

results, err := w.AccountBalances(waddrmgr.KeyScopeBIP0044, int32(*cmd.MinConf))

btcctl --wallet getbalance default

0.10720198

calculated correctly via

bals, err := w.CalculateAccountBalances(account, int32(*cmd.MinConf))

Question:

Is the current implementation as intended, or should the command be checking account balances across all key scopes?

If this is not intended behavior, I would be interested in contributing a pull request to address this.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant