-
Notifications
You must be signed in to change notification settings - Fork 725
[BUG] Consider also DMNs in CountEnabled and CountNetworks #2565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Consider also DMNs in CountEnabled and CountNetworks #2565
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
|
Rebased. |
furszy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice discovery streak 👌. Several issues caught and solved at once :).
Reviewed up to 2730521
furszy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Fuzzbawls
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code/Tests ACK 0f5064f
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.