Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remaking #32 after new repo was created. Original un-squashed branch here.
This implements vote bits (re)synchronization/repair. Please test and review. All of the new or modified functionality is tested on a testnet pool, but there may be more attack protections that should be made (walletRPCHandlerize any of this?).
In terms of behavior:
Implementation:
It needs a dcrrpcclient version change for the new GetTickets RPC.
Issues:
getstakeinfo
's immature includes unmined, whereasgettickets
does not include mempool. This prevents the startup check from passingint(gsi.Live+gsi.Immature) != numLiveTickets
while tickets are in mempool. All is well after tickets get mined. Workaround is to avoid such a check, and only check that the wallets agree with eachother w.r.t. gettickets.SyncVoteBits
will either report different numbers of tickets (before they are processing the import/sync) or report -4: syncing... here Rather than quit, the solution is to just skip the full ticket vote bits sync (check and repair). The vote bits are repaired on-demand via /tickets.Startup auto-repair:
User changing vote bits, if process exceeds 3 seconds: