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

blockchain.get_all_accounts() returns duplicate entries #27

Closed
crokkon opened this issue Jun 15, 2018 · 0 comments
Closed

blockchain.get_all_accounts() returns duplicate entries #27

crokkon opened this issue Jun 15, 2018 · 0 comments

Comments

@crokkon
Copy link
Contributor

crokkon commented Jun 15, 2018

Expected behavior

blockchain.get_all_accounts(limit=5000) should return the first 5000 Steem accounts

Actual behavior

blockchain.get_all_accounts(limit=5000) returns 5000 account names, however 4 of them are contained twice in the list, leaving 4996 unique account names

How to reproduce

>>> from beem import blockchain
>>> b = Blockchain()
>>> len(list(b.get_all_accounts(limit=5000)))
5000
>>> len(set(b.get_all_accounts(limit=5000)))
4996

The reason is that the accounts are fetched in batches (default: 1000 accounts per RPC call) where the last result of the previous batch is also the first result of the next batch.

holgern added a commit that referenced this issue Jun 15, 2018
* Unit test for issue #27 added
* Exception handling added to blocks using threads
* get_all_accounts fixed for appbase calls
@holgern holgern closed this as completed Jun 15, 2018
crokkon added a commit to crokkon/beem that referenced this issue Jun 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants