-
Notifications
You must be signed in to change notification settings - Fork 282
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
Adjust txdb locked coins balance for FINALIZE covenants #464
Conversation
Codecov Report
@@ Coverage Diff @@
## master #464 +/- ##
==========================================
+ Coverage 62.53% 62.59% +0.06%
==========================================
Files 129 129
Lines 34864 34886 +22
Branches 5925 5935 +10
==========================================
+ Hits 21803 21838 +35
+ Misses 13061 13048 -13
Continue to review full report at Codecov.
|
@tynes great feedback thank you! All suggestions taken, pushed two more commits. |
Maybe we could schedule a "review session" for this PR because the longer that we wait to get this in, the more difficult the upgrade will be. |
Good idea. I also think that like the change migration bug, we should evaluate and merge this fix ASAP to prevent new wallet corruption in the community, but then we need to figure out if another migration is necessary for wallets that have already been corrupted. |
Pull Request Test Coverage Report for Build 238000825
💛 - Coveralls |
Ok after sitting on this for a long time, I think we should merge as is. I tried to play with a migration fix this morning but I think the best method will be a Deep Rescan and again we'll just have to explain in the CHANGELOG |
I think we may have overlooked the impact of FINALIZE covenants on locked coins balances in the wallet. They are unusual because it is the only case where locked coins leave the wallet. Meaning someone else's locked coin balance goes up. The current txdb functions
lockBalances()
andunlockBalances()
process covenants received into the wallet, however in this case we must also catch FINALIZE as it is being sent, since our own locked coin balance goes down (along with the total balance - name and coins get transferred)TODO:
According to my covenant statistics script, at this time there are 14
FINALIZE
covenants confirmed on the blockchain, for a total value of 3,700.500000 HNS. Both the sender and receiver of these names will have inaccurate locked coin balances, that may end up throwing an assertion error depending on future wallet activity.Similar PRs recently merged affecting txdb locked coins computation:
#438
#387
#262