From ede451906a21bac6b688658d86c8722136a95cad Mon Sep 17 00:00:00 2001 From: random-zebra Date: Fri, 21 May 2021 09:20:15 +0200 Subject: [PATCH] [Cleanup] Remove unused parameter in GetCurrentMasternode Also pass the genesis hash instead of a null hash (as it was the original behavior before bfa628e2db8faf8f20d55e71f9357a7353df4012) when no-masternode-to-pay is found in GetLegacyMasternodeTxOut (e.g. when there are less than 9 masternodes enabled on the network, and they are all scheduled already). --- src/masternode-payments.cpp | 2 +- src/masternodeman.cpp | 4 ++-- src/masternodeman.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/masternode-payments.cpp b/src/masternode-payments.cpp index 6fab344cd196b..00592e68fa9d6 100644 --- a/src/masternode-payments.cpp +++ b/src/masternode-payments.cpp @@ -324,7 +324,7 @@ bool CMasternodePayments::GetLegacyMasternodeTxOut(int nHeight, std::vectorGetPayeeScript(); } else { diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index 58d9b4fc8630f..bf954a92c49e3 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -572,7 +572,7 @@ MasternodeRef CMasternodeMan::GetNextMasternodeInQueueForPayment(int nBlockHeigh return pBestMasternode; } -MasternodeRef CMasternodeMan::GetCurrentMasterNode(int nHeight, const uint256& hash) const +MasternodeRef CMasternodeMan::GetCurrentMasterNode(const uint256& hash) const { int minProtocol = ActiveProtocol(); int64_t score = 0; @@ -617,7 +617,7 @@ std::vector> CMasternodeMan::GetMnScores(int nLast for (int nHeight = nChainHeight - nLast; nHeight < nChainHeight + 20; nHeight++) { const uint256& hash = GetHashAtHeight(nHeight - 101); - MasternodeRef winner = GetCurrentMasterNode(nHeight, hash); + MasternodeRef winner = GetCurrentMasterNode(hash); if (winner) { ret.emplace_back(winner, nHeight); } diff --git a/src/masternodeman.h b/src/masternodeman.h index ed9c5276472db..9bc24a98428d5 100644 --- a/src/masternodeman.h +++ b/src/masternodeman.h @@ -144,8 +144,8 @@ class CMasternodeMan /// Find an entry in the masternode list that is next to be paid MasternodeRef GetNextMasternodeInQueueForPayment(int nBlockHeight, bool fFilterSigTime, int& nCount, const CBlockIndex* pChainTip = nullptr) const; - /// Get the current winner for this block - MasternodeRef GetCurrentMasterNode(int nHeight, const uint256& hash) const; + /// Get the winner for this block hash + MasternodeRef GetCurrentMasterNode(const uint256& hash) const; /// vector of pairs std::vector> GetMnScores(int nLast) const;