[BUG] Consider also DMNs in CountEnabled and CountNetworks#2565
Merged
furszy merged 8 commits intoPIVX-Project:masterfrom Oct 1, 2021
Merged
[BUG] Consider also DMNs in CountEnabled and CountNetworks#2565furszy merged 8 commits intoPIVX-Project:masterfrom
furszy merged 8 commits intoPIVX-Project:masterfrom
Conversation
except when dealing with mnsync (only legacy list is synced via P2P)
CountEnabled is being called while holding CMasternodeMan::cs, by SecondsSincePayment, and it locks CDeterministicMNManager::cs to get the deterministic manager's tip height. Pass the enabled masternode count to SecondsSincePayment, directly from the caller, so the two locks are not held at the same time.
Since the count must always remain 0 when the legacy system is obsolete
0ca2ad7 to
52b7b9b
Compare
52b7b9b to
4e89bb2
Compare
Author
|
Rebased. |
furszy
approved these changes
Sep 25, 2021
furszy
left a comment
There was a problem hiding this comment.
Code review ACK 0f5064f with a topic.
About 4e89bb2:
From a readability perspective, what do you think about moving the IsMNValid function inside the DMN class instead of completely removing it?
When i read it, the first time, it was not so clear that IsMNPoSeBanned had the same meaning.
(maybe could even not call it "valid" and use "enabled" wording instead).
|
Changed my mind after having a convo about it with zebra, all good over the |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bug introduced in #2308.
We are considering the total masternode count, inclusive of deterministic masternodes, only in
GetNextMasternodeInQueueForPayment, but not in other places.Fix this by updating directly the function
CountEnabled, using the legacy-only count exclusively for the masternode list sync.