Prepare for DIP3 operator reward payments and switch to array in getblocktemplate#2216
Conversation
UdjinM6
left a comment
There was a problem hiding this comment.
Looks good 👍 Just one issue with params/variables naming.
src/masternode-payments.cpp
Outdated
There was a problem hiding this comment.
std::vector<CTxOut>s have vout prefix in code currently (vout in CTransaction and voutSuperblockRet in mnpayments/governance/blocktemplate), let's keep it consistent maybe i.e. s/txoutsMasternodeRet/voutMasternodeRet/ or (even more descriptive) s/txoutsMasternodeRet/voutMasternodePaymentsRet/ ?
src/masternode-payments.cpp
Outdated
src/miner.h
Outdated
src/masternode-payments.cpp
Outdated
src/masternode-payments.cpp
Outdated
src/masternode-payments.cpp
Outdated
src/rpc/mining.cpp
Outdated
src/validation.cpp
Outdated
10cf32d to
64d0572
Compare
64d0572 to
08e4c3c
Compare
|
Rebased on develop, so #2215 commits are removed from here now. |
src/validation.cpp
Outdated
There was a problem hiding this comment.
This looks like a temporary shortcut thb which would make little sense after there are many MNs paid in one block. Should probably write this part correctly i.e. "continue if one of paid masternodes is unknown" and "continue if one of masternodes is not upgraded" below.
There was a problem hiding this comment.
Actually, the idea behind voutMasternodePayments is not to pay multiple masternodes but to split the masternode reward into masternode payment and operator reward payment. Even in the case of masternode shares, a block will still only pay a single masternode but split the reward into multiple recipients.
I added a commit on top which loops through all txouts and if none of them is a masternode payment, it continues.
…locktemplate This commit allows to later split MN rewards into multiple recipients, e.g. the owner reward and operator reward. It also updates the getblocktemplate output to return an array of MN payments instead of a single entry. This should allow MN miners and pool operators to prepare themself for the upcoming changes in regard to operator rewards.
08e4c3c to
e9fe5fc
Compare
- Change `masternode` to array of objects - Related to dashpay/dash#2216
- Change `masternode` to array of objects - Related to dashpay/dash#2216
…e recent refactorings (dashpay#2237) partially reverts dashpay#2216
This PR also includes the commits of #2215. I'll rebase and force-push after that one is merged. Only the last commit is actually part of this PR.This refactoring might look useless without the operator rewards from DIP3, but I'd like at least include the getblocktemplate change ASAP so that miners and pools operators can prepare themself for the upcoming changes.