You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
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 whatSwapping
shows (soSwapping
isn't actually included intoLocked
but rather is a part ofAvailable
) ...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 forSwapping
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
Swapping
&Bonded
balances asLocked
(meaning, if it counts in one of those sections it should always be counted underLocked
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 transactionThe text was updated successfully, but these errors were encountered: