Skip to content

Conversation

@domob1812
Copy link

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.

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.
@galpHub galpHub merged commit 0789912 into DiviProject:Development Nov 6, 2020
@domob1812 domob1812 deleted the refactor-for-reward-addr branch November 9, 2020 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants