mixsDone gets forgotten, how to reconstruct
Created by: blamb5
I have been mixing several hundreds of addresses with mixs-target=10 and after months I had a few dozens of mixsDone=10. But then all of sudden I noticed that many 10s disappeared and got reset to 1. Not all of them and probably not just 10s. Simply it seemed like I had done many fewer mixes than in the reality. I don't know how it happened, I didn't do anything strange with the cli, only I stopped it quite many times to compile a new version from git. Fortunately I did have some oldish backups of both json files but still I "lost" several months of mixing. I shrugged and let it be until yesterday, another couple of months of mixing later, I again noticed that many mixsDone had been reset to 1. so I am letting you know that there might be a bug. Maybe something is wrong with my machine but it's a stable powerful underutilized server with a rather reliable filesystem (zfs on raid1) so I don't know. Maybe it happened to other people too, they just never noticed.
So I decided to recalculate the correct mixsDone values and fix the whirlpool-cli-utxos-xxx.json file. From zpub I generated a list of my addresses and then I took each utxo (just a copy&paste of UTXO column from "O" cli command output) and went back in transactions and counted how many times one of the input addresses belongs to my list and that was the correct mixsDone. Now all my mixsDone are correct again, I even got a couple of mixsDone=11.
If anyone notices the same problem, here is a little tool for this reconstruction I made in Python: https://pastebin.com/W0b4dqp3