[WIP] stakepoold: fix newly matured tkt edge case #250
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.
As mentioned in the linked issue, there's an edge case where a ticket
can mature and be picked to vote in the same block. When this happens
it's basically just the luck of the draw as to if the new ticket
notification arrives before the winning ticket notification. If it
doesn't, then we will fail to vote since we aren't aware of its presence
when we go to vote it. This keeps a map of unknown winning tickets and
will attempt to vote such tickets from the new ticket handler.
WIP, needs tests added and live testing (and probably some more refactoring).
This shouldn't be a frequent occurrence on mainnet but still needs to be
addressed since it has been hit in production.
Resolves #249.