Skip to content

Commit

Permalink
clarifies some calculations on CRewards::ConnectBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-at-decenomy committed May 22, 2024
1 parent 893ae3b commit c794437
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rewards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,11 @@ bool CRewards::ConnectBlock(CBlockIndex* pindex, CAmount nSubsidy, CCoinsViewCac
oss << "nSupplyTargetEmission: " << FormatMoney(nSupplyTargetEmission) << std::endl;
const auto nCirculatingTargetEmission = ((nCirculatingSupply / (365LL * nBlocksPerDay)) / 1000000) * nCirculatingEmissionRate * nRewardAdjustmentInterval;
oss << "nCirculatingTargetEmission: " << FormatMoney(nCirculatingTargetEmission) << std::endl;
const auto nTargetEmission = (nSupplyTargetEmission + nCirculatingTargetEmission) / 2LL;
oss << "nTargetEmission: " << FormatMoney(nTargetEmission) << std::endl;

// calculate required delta values
const auto nDelta = (nActualEmission - ((nSupplyTargetEmission + nCirculatingTargetEmission) / 2LL)) / nRewardAdjustmentInterval;
const auto nDelta = (nActualEmission - nTargetEmission) / nRewardAdjustmentInterval;
oss << "nDelta: " << FormatMoney(nDelta) << std::endl;

// y = mx + b
Expand Down

0 comments on commit c794437

Please sign in to comment.