Skip to content

Commit 8f74f3a

Browse files
committed
refactor: fix bad naming of namespace CMasternodePayments -> MasternodePayments
1 parent a679f8b commit 8f74f3a

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

src/masternode/payments.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ static bool GetMasternodeTxOuts(const int nBlockHeight, const CAmount blockRewar
6565
voutMasternodePaymentsRet.clear();
6666

6767
if(!GetBlockTxOuts(nBlockHeight, blockReward, voutMasternodePaymentsRet)) {
68-
LogPrintf("CMasternodePayments::%s -- no payee (deterministic masternode list empty)\n", __func__);
68+
LogPrintf("MasternodePayments::%s -- no payee (deterministic masternode list empty)\n", __func__);
6969
return false;
7070
}
7171

7272
for (const auto& txout : voutMasternodePaymentsRet) {
7373
CTxDestination dest;
7474
ExtractDestination(txout.scriptPubKey, dest);
7575

76-
LogPrintf("CMasternodePayments::%s -- Masternode payment %lld to %s\n", __func__, txout.nValue, EncodeDestination(dest));
76+
LogPrintf("MasternodePayments::%s -- Masternode payment %lld to %s\n", __func__, txout.nValue, EncodeDestination(dest));
7777
}
7878

7979
return true;
@@ -88,7 +88,7 @@ static bool IsTransactionValid(const CTransaction& txNew, const int nBlockHeight
8888

8989
std::vector<CTxOut> voutMasternodePayments;
9090
if (!GetBlockTxOuts(nBlockHeight, blockReward, voutMasternodePayments)) {
91-
LogPrintf("CMasternodePayments::%s -- ERROR failed to get payees for block at height %s\n", __func__, nBlockHeight);
91+
LogPrintf("MasternodePayments::%s -- ERROR failed to get payees for block at height %s\n", __func__, nBlockHeight);
9292
return true;
9393
}
9494

@@ -98,7 +98,7 @@ static bool IsTransactionValid(const CTransaction& txNew, const int nBlockHeight
9898
CTxDestination dest;
9999
if (!ExtractDestination(txout.scriptPubKey, dest))
100100
assert(false);
101-
LogPrintf("CMasternodePayments::%s -- ERROR failed to find expected payee %s in block at height %s\n", __func__, EncodeDestination(dest), nBlockHeight);
101+
LogPrintf("MasternodePayments::%s -- ERROR failed to find expected payee %s in block at height %s\n", __func__, EncodeDestination(dest), nBlockHeight);
102102
return false;
103103
}
104104
}
@@ -147,7 +147,7 @@ static bool IsOldBudgetBlockValueValid(const CMasternodeSync& mn_sync, const CBl
147147
return isBlockRewardValueMet;
148148
}
149149

150-
namespace CMasternodePayments {
150+
namespace MasternodePayments {
151151

152152
/**
153153
* IsBlockValueValid
@@ -329,4 +329,4 @@ void FillBlockPayments(const CSporkManager& sporkManager, CGovernanceManager& go
329329
nBlockHeight, blockReward, voutMasternodeStr, txNew.ToString());
330330
}
331331

332-
} // namespace CMasternodePayments
332+
} // namespace MasternodePayments

src/masternode/payments.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ class CSporkManager;
1818
class CTxOut;
1919
class CMasternodeSync;
2020

21-
//
22-
// Masternode Payments Class
23-
// Keeps track of who should get paid for which blocks
24-
//
21+
/**
22+
* Masternode Payments Namespace
23+
* Helpers to kees track of who should get paid for which blocks
24+
*/
2525

26-
namespace CMasternodePayments
26+
namespace MasternodePayments
2727
{
2828
bool IsBlockValueValid(const CSporkManager& sporkManager, CGovernanceManager& governanceManager, const CMasternodeSync& mn_sync,
2929
const CBlock& block, const int nBlockHeight, const CAmount blockReward, std::string& strErrorRet);
@@ -32,6 +32,6 @@ bool IsBlockPayeeValid(const CSporkManager& sporkManager, CGovernanceManager& go
3232
void FillBlockPayments(const CSporkManager& sporkManager, CGovernanceManager& governanceManager,
3333
CMutableTransaction& txNew, const int nBlockHeight, const CAmount blockReward,
3434
std::vector<CTxOut>& voutMasternodePaymentsRet, std::vector<CTxOut>& voutSuperblockPaymentsRet);
35-
} // namespace CMasternodePayments
35+
} // namespace MasternodePayments
3636

3737
#endif // BITCOIN_MASTERNODE_PAYMENTS_H

src/miner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
240240

241241
// Update coinbase transaction with additional info about masternode and governance payments,
242242
// get some info back to pass to getblocktemplate
243-
CMasternodePayments::FillBlockPayments(spork_manager, governance_manager, coinbaseTx, nHeight, blockReward, pblocktemplate->voutMasternodePayments, pblocktemplate->voutSuperblockPayments);
243+
MasternodePayments::FillBlockPayments(spork_manager, governance_manager, coinbaseTx, nHeight, blockReward, pblocktemplate->voutMasternodePayments, pblocktemplate->voutSuperblockPayments);
244244

245245
pblock->vtx[0] = MakeTransactionRef(std::move(coinbaseTx));
246246
pblocktemplate->vTxFees[0] = -nFees;

src/rpc/masternode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ static UniValue masternode_payments(const JSONRPCRequest& request, const Chainst
460460
std::vector<CTxOut> voutMasternodePayments, voutDummy;
461461
CMutableTransaction dummyTx;
462462
CAmount blockReward = nBlockFees + GetBlockSubsidy(pindex->pprev->nBits, pindex->pprev->nHeight, Params().GetConsensus());
463-
CMasternodePayments::FillBlockPayments(*sporkManager, *governance, dummyTx, pindex->nHeight, blockReward, voutMasternodePayments, voutDummy);
463+
MasternodePayments::FillBlockPayments(*sporkManager, *governance, dummyTx, pindex->nHeight, blockReward, voutMasternodePayments, voutDummy);
464464

465465
UniValue blockObj(UniValue::VOBJ);
466466
CAmount payedPerBlock{0};

src/validation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,7 +2407,7 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state,
24072407
int64_t nTime5_2 = GetTimeMicros(); nTimeSubsidy += nTime5_2 - nTime5_1;
24082408
LogPrint(BCLog::BENCHMARK, " - GetBlockSubsidy: %.2fms [%.2fs (%.2fms/blk)]\n", MILLI * (nTime5_2 - nTime5_1), nTimeSubsidy * MICRO, nTimeSubsidy * MILLI / nBlocksTotal);
24092409

2410-
if (!CMasternodePayments::IsBlockValueValid(*sporkManager, *governance, *::masternodeSync, block, pindex->nHeight, blockReward, strError)) {
2410+
if (!MasternodePayments::IsBlockValueValid(*sporkManager, *governance, *::masternodeSync, block, pindex->nHeight, blockReward, strError)) {
24112411
// NOTE: Do not punish, the node might be missing governance data
24122412
LogPrintf("ERROR: ConnectBlock(DASH): %s\n", strError);
24132413
return state.Invalid(BlockValidationResult::BLOCK_RESULT_UNSET, "bad-cb-amount");
@@ -2416,7 +2416,7 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state,
24162416
int64_t nTime5_3 = GetTimeMicros(); nTimeValueValid += nTime5_3 - nTime5_2;
24172417
LogPrint(BCLog::BENCHMARK, " - IsBlockValueValid: %.2fms [%.2fs (%.2fms/blk)]\n", MILLI * (nTime5_3 - nTime5_2), nTimeValueValid * MICRO, nTimeValueValid * MILLI / nBlocksTotal);
24182418

2419-
if (!CMasternodePayments::IsBlockPayeeValid(*sporkManager, *governance, *block.vtx[0], pindex->nHeight, blockReward)) {
2419+
if (!MasternodePayments::IsBlockPayeeValid(*sporkManager, *governance, *block.vtx[0], pindex->nHeight, blockReward)) {
24202420
// NOTE: Do not punish, the node might be missing governance data
24212421
LogPrintf("ERROR: ConnectBlock(DASH): couldn't find masternode or superblock payments\n");
24222422
return state.Invalid(BlockValidationResult::BLOCK_RESULT_UNSET, "bad-cb-payee");

0 commit comments

Comments
 (0)