Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Wallet RPC: add address index filter to get_balance #4168

Closed
artyomsol opened this issue Jul 23, 2018 · 5 comments
Closed

Wallet RPC: add address index filter to get_balance #4168

artyomsol opened this issue Jul 23, 2018 · 5 comments
Labels

Comments

@artyomsol
Copy link
Contributor

artyomsol commented Jul 23, 2018

In case of hundreds / thousands / millions of managed subaddresses the get_balance response of the RPC API will become a huge JSON as of current implementation.
An address_index parameter (array of unsigned int; (Optional) List of subaddress indices to return from an account) should be added to optionally filter the "per_subaddress" array of the method response.
Totals for the account balance ("balance" and "unlocked_balance") should be calculated for the all of subaddresses despite of the filter parameter specified.

@stoffu
Copy link
Contributor

stoffu commented Jul 23, 2018

#4171

@stoffu
Copy link
Contributor

stoffu commented Jul 23, 2018

I've closed #4171 because it was tailored to the wrong use of subaddresses: if you need to issue millions of subaddresses to handle many users' deposits, you should use the create_account command for each user. Accounts are meant for managing individual users' balances, while subaddresses within the same account (i.e. having the same major index) are meant to be used for issuing one-time throwaway addresses (i.e. ShapeShift scenario in #2056).

@artyomsol
Copy link
Contributor Author

artyomsol commented Jul 23, 2018

@stoffu Sorry but your doubt is irrelevant to the issue you've solved. It does not matter what for a wallet owner need to create millions of subaddresses. Having ShapeShift scenario you will face a trouble when get_balance will return ALL subaddresses in response all the time. While you will be interesting in some limited set of recently issued throwaway addresses.

@stoffu
Copy link
Contributor

stoffu commented Jul 24, 2018

Having ShapeShift scenario you will face a trouble when get_balance will return ALL subaddresses in response all the time.

This is not the case unless you only receive funds and never spend them; when spending them, the change goes back to the base address (minor index = 0) such that the funds accumulate in the base address.

Anyway, I reopened #4171 as it doesn't change the default behavior and seems harmless.

@moneromooo-monero
Copy link
Collaborator

+resolved

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

No branches or pull requests

4 participants