Refactor MN payee logic in preparation for DIP3#2215
Merged
UdjinM6 merged 3 commits intodashpay:developfrom Aug 12, 2018
Merged
Refactor MN payee logic in preparation for DIP3#2215UdjinM6 merged 3 commits intodashpay:developfrom
UdjinM6 merged 3 commits intodashpay:developfrom
Conversation
UdjinM6
reviewed
Aug 10, 2018
UdjinM6
left a comment
There was a problem hiding this comment.
Looks good, just one small code-style issue
src/masternode-payments.cpp
Outdated
There was a problem hiding this comment.
These changes leaked from a27c49699cc2614e9d19c09a044171caa383e815 I guess but it's ok, will be swashed on merge anyway :)
src/masternode-payments.cpp
Outdated
There was a problem hiding this comment.
& should be aligned to the left https://github.com/dashpay/dash/blob/master/doc/developer-notes.md
1. Move out old budget validation into it's own function (IsOldBudgetBlockValueValid) 2. Refactor IsBlockValueValid to bail out early instead of using deep nested if/else blocks. IMHO, I feel that this makes the code much easier to read and less error prone. 3. Refactor/rename CreateSuperblock and CMasternodePayments::FillBlockPayee to be getters without actually modifying the coinbase TX. The coinbase is now only modified from the global FillBlockPayments function. Makes later changes in DIP3 easier (allowing superblock and MN rewards in same block)
4f8ec1c to
2773891
Compare
Author
|
Rebased on develop after #2212 was merged. |
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.
This PR also includes the commits of #2212. I'll rebase and force-push after that one is merged. Only the last 2 commits are actually part of this PR.These commits are extracted from #2083 and slightly modified to work with the current develop branch. The original commit also enabled payment of MN rewards and superblock payments in the same block. The logic is still included in this modified commit, but hardcoded to always be disabled. When rebasing #2212, this logic will be enabled depending on spork15 (as in the original commit).