forked from PIVX-Project/PIVX
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix db leaks in LLMQ db (PIVX-Project#2914)
* Store rs_t key time in big endian Also implement ConvertInvalidTimeKeys to convert old entries. We can remove this later when we know that most MNs have run this code on testnet. The way we stored the time field in the past lead to CleanupOldRecoveredSigs iterating the keys in a strange order, causing no deletion at all and the LLMQ DB filling up. * Write batch in CleanupOldRecoveredSigs when it gets too large This avoids RAM filling up and OOM getting triggered. * Keep track of when a vote was written to the DB and clean up after week Instead of only deleting when the corresponding recovered sig is deleted. It sometimes happens that a masternode votes on something but a recovered sig is never created, which leaves us with a vote that will never be deleted. * Apply suggestions from code review Co-Authored-By: PastaPastaPasta <pasta@dashboost.org>
- Loading branch information
Showing
2 changed files
with
151 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters