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

fix bug: esplora negative balance #35

Merged
merged 1 commit into from
May 28, 2024

Conversation

eauxxs
Copy link
Contributor

@eauxxs eauxxs commented May 25, 2024

Because explora's API document describes that an address can obtain up to 50 mempool + 25 confirmed results in one request, so if the returned results are 25 or more, we should request again to obtain more. Otherwise, the final balance resulting in the calculation may be a negative number.

@eauxxs
Copy link
Contributor Author

eauxxs commented May 25, 2024

RGB-WG/rgb#176

@dr-orlovsky dr-orlovsky added the bug Something isn't working label May 26, 2024
@dr-orlovsky dr-orlovsky added this to the v0.11.0 milestone May 26, 2024
Copy link
Member

@dr-orlovsky dr-orlovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Will wait for @zoedberg review since she has more experience with indexers

@zoedberg
Copy link
Contributor

I confirm this should fix the balance calculation in case the user received a lot of TXs on the same script. I'm not sure that this fixes RGB-WG/rgb#176 though, because in the sandbox (which is the tool used when that issue has been found) we don't do many TXs and we always create new addresses before requesting more funds.

Copy link
Member

@dr-orlovsky dr-orlovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK dd7401a

@dr-orlovsky dr-orlovsky merged commit 4e088c4 into BP-WG:master May 28, 2024
3 of 5 checks passed
@eauxxs
Copy link
Contributor Author

eauxxs commented May 29, 2024

@zoedberg It is exactly what you said. I fixed this bug not because of the issue. I encountered this problem during my testing. And I saw that his issue description is exactly the same as mine. I downloaded his attachment and found that there are only two tx in it. Maybe his situation is different from mine. He can try to pull this PR and see if it can be fixed. Thank you very much for your review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants