-
Notifications
You must be signed in to change notification settings - Fork 101
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
fix: masternode list sync and block reward #240
Conversation
…-> 20%) Signed-off-by: HashEngineering <[email protected]>
Signed-off-by: HashEngineering <[email protected]>
…the last qrinfo list * The QRInfo list may be up to 12 hours old * this resolves a masternode list sync bug when requesting mnlistdiff Signed-off-by: HashEngineering <[email protected]>
public boolean isHPMN() { | ||
return type == MasternodeType.HIGHPERFORMANCE.index; | ||
} |
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.
This is required by Dash Wallet for Masternode APY.
public SimplifiedMasternodeList getListAtChainTip() { | ||
return getMasternodeList(); | ||
if (quorumState.getMasternodeListAtTip() != null) { | ||
return quorumState.getMasternodeListAtTip(); | ||
} else { | ||
return quorumRotationState.getMnListAtH(); | ||
} | ||
} |
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.
This helps fix a sync issue. When checking if mnlistdiff
needs to be requested, we were actually checking the wrong list from qrinfo
. Additionally in Dash Wallet, the block height used for the CrowdNode APY was from qrinfo
which could be up to 12 hours old, rather than the most recent masternode list block height.
int treasuryPart = params.isV20Active(nPrevHeight) ? 20 : 10; // parts per 100, 20 is 20% | ||
Coin nSuperblockPart = (nPrevHeight > params.getBudgetPaymentsStartBlock()) ? nSubsidy.multiply(treasuryPart).div(100) : Coin.ZERO; |
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.
This updates for the new Treasury size of 20% once v20 is active.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #240 +/- ##
============================================
+ Coverage 48.00% 48.02% +0.01%
+ Complexity 6666 6665 -1
============================================
Files 409 409
Lines 46110 46117 +7
Branches 6502 6503 +1
============================================
+ Hits 22136 22148 +12
+ Misses 21570 21557 -13
- Partials 2404 2412 +8 ☔ View full report in Codecov by Sentry. |
Signed-off-by: HashEngineering <[email protected]>
Signed-off-by: HashEngineering <[email protected]>
quorumState.initChainTipSyncComplete = false; | ||
quorumRotationState.initChainTipSyncComplete = false; | ||
quorumState.close(); | ||
quorumRotationState.close(); |
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.
need to reset more of the sync state than this one value.
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.
One reason for "Syncing..." was that it was waiting for a reply to a message sent before the network was completely disconnected. After starting up, the wait
flag was still set to true. While waiting, we don't request again.
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.
Looks good
Issue being fixed or feature implemented
What was done?
How Has This Been Tested?
Breaking Changes
Checklist:
For repository code-owners and collaborators only