Simplification of masternode payment code#47
Merged
galpHub merged 4 commits intoDiviProject:Developmentfrom Nov 6, 2020
Merged
Simplification of masternode payment code#47galpHub merged 4 commits intoDiviProject:Developmentfrom
galpHub merged 4 commits intoDiviProject:Developmentfrom
Conversation
Minor cleanups in the code handling the masternode payee address, removing unnecessary complications and making the code more readable.
For CMasternodeBroadcast and CMasternodePing, use the method getMessageToSign also when verifying signatures, rather than duplicating the logic inline again.
General cleanups in the masternode.h / masternode.cpp code, mostly marking functions as const that should be, and making things more private.
Looking up a masternode by payee script is error-prone, as it is not a unique identifier. Multiple masternodes could be using the same collateral address (and may in the future use the same reward address). The only place where this is being used is in verifying a mnw message. Instead of the previous logic relying on the lookup (which was hard to read anyway), just explicitly check that the payee matches one of the masternodes in our payment queue.
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 splits out the first couple of commits from #44. They contain just general refactorings and simplifications of the code in preparation for custom reward addresses, without any of the actual forking logic / changes to the P2P protocol or consensus.