From 9700eb92d4d9a52735cc7180287664bffab50786 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Fri, 1 Sep 2023 01:57:07 +0700 Subject: [PATCH] refactor: missing usage of MasternodePayments::PlatformShare --- src/evo/creditpool.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/evo/creditpool.cpp b/src/evo/creditpool.cpp index 9b34b585fb24b0..89a2cf6aa76959 100644 --- a/src/evo/creditpool.cpp +++ b/src/evo/creditpool.cpp @@ -18,6 +18,11 @@ #include #include +// Forward declaration to prevent a new circular dependencies through masternode/payments.h +namespace MasternodePayments { +CAmount PlatformShare(const CAmount masternodeReward); +} // namespace MasternodePayments + static const std::string DB_CREDITPOOL_SNAPSHOT = "cpm_S"; std::unique_ptr creditPoolManager; @@ -241,7 +246,7 @@ bool CCreditPoolDiff::SetTarget(const CTransaction& tx, TxValidationState& state for (const CTxOut& txout : tx.vout) { blockReward += txout.nValue; } - masternodeReward = 0.375 * GetMasternodePayment(cbTx.nHeight, blockReward, params.BRRHeight); + masternodeReward = MasternodePayments::PlatformShare(GetMasternodePayment(cbTx.nHeight, blockReward, params.BRRHeight)); LogPrintf("CreditPool: set target to %lld with MN reward %lld\n", *targetBalance, masternodeReward); return true;