ironfish
ironfish copied to clipboard
Inconsistent/Inaccurate Confirmed Balance - During Deposit
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.
Version
0.1.49
Debug output
No response
Relevant log output
No response
Graffiti
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.
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?
Yes I'm on 1.51 now. Balances seem more accurate.