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: incorrect total/locked balance displayed in UI (double-counting) #3131

Open
norwnd opened this issue Dec 30, 2024 · 0 comments
Open

Comments

@norwnd
Copy link
Contributor

norwnd commented Dec 30, 2024

I've noticed swap funds are counted twice in Total wallet balance displayed in UI (and likely bond-locked as well?).

Digging through the relevant code a bit I think the following adjustments should resolve it - norwnd@730aea9 (it's a bit of a hurdle for me to create actual PR with the change - but feel free to borrow whatever code you see fit, and pls let me know if it's actually wrong).

Update:

It seems the issue goes a bit deeper, now with that commit from above I have my total Locked balance showing smaller value than what Swapping shows (so Swapping isn't actually included into Locked but rather is a part of Available) ...

I should note, the Swap transaction in question didn't get mined due to low fee (have been hanging for days) and now corresponding Match shows "Refund ... Will happen in the next few blocks" - which is a separate issue - the relevant part being Polygon wallet now seems to gave up on that Swap transaction and counts these funds as Available while these funds still show under locked for Swapping as well (which is technically correct since it's theoretically possible for that Swap transaction to get mined still unless I send another transaction with the same nonce - but displaying it in UI like that is confusing),

and so it seems the best way to resolve it would be to

  • always count Swapping & Bonded balances as Locked (meaning, if it counts in one of those sections it should always be counted under Locked as well, and vice versa)

btw, (just note) it still counts those funds as Swapping even after I used that same Polygon nonce that would completely invalidate corresponding Swap transaction

@norwnd norwnd changed the title wallet: balance incorrectly counts locked funds (double-counting) wallet: incorrect total/locked balance displayed in UI (double-counting) Dec 30, 2024
@decred decred deleted a comment Dec 30, 2024
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
@norwnd and others