ironfish icon indicating copy to clipboard operation
ironfish copied to clipboard

Inconsistent/Inaccurate Confirmed Balance - During Deposit

Open airj1012 opened this issue 2 years ago • 1 comments

What happened?

While running ironfish depost-all, I noticed that all the coins moved over to the unconfirmed balance. However as the unconfirmed balance was being worked on, I noticed the confirmed balance jumping around. See the attached screens where you can see it working correctly, broken, and working properly again. You can see timestamps from the clock on the screens too. The bug is visible in the second screen.

image image image

Version

0.1.49

Debug output

No response

Relevant log output

No response

Graffiti

airj1012

airj1012 avatar Oct 09 '22 21:10 airj1012

What you're seeing here is likely due to the way UTXO-based cryptocurrencies like Iron Fish work.

Your balance consists of 'notes' which are a lot like notes in paper money -- they're unique and represent a specific amount of money. When you deposit IRON you spend one (or more) of your notes. If the amount that you're depositing is less than the full amount of the note then you get the rest back as 'change' in a new note. However, until the transaction is confirmed by the network you can't spend the change that you get back.

This is why your 'confirmed' balance shows as 0: the confirmed notes in your wallet have been spent in deposits, but those deposits haven't been confirmed yet. You can't double-spend the confirmed note and you can't spend the change yet because the deposit transaction might not go through.

hughy avatar Oct 11 '22 17:10 hughy

There was a bug in the wallet that caused spent notes to be marked as unspent. It was fixed in #2399 and released in v0.1.50. That may have caused what you saw here!

Have you continued to see this issue on v0.1.50 or v0.1.51?

hughy avatar Nov 02 '22 23:11 hughy

Yes I'm on 1.51 now. Balances seem more accurate.

airj1012 avatar Nov 03 '22 11:11 airj1012