MCPcopy Create free account
hub / github.com/Bitcoin-ABC/bitcoin-abc / GetBlockSubsidy

Function GetBlockSubsidy

src/validation.cpp:1487–1498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1485}
1486
1487Amount GetBlockSubsidy(int nHeight, const Consensus::Params &consensusParams) {
1488 int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
1489 // Force block reward to zero when right shift is undefined.
1490 if (halvings >= 64) {
1491 return Amount::zero();
1492 }
1493
1494 Amount nSubsidy = 50 * COIN;
1495 // Subsidy is cut in half every 210,000 blocks which will occur
1496 // approximately every 4 years.
1497 return ((nSubsidy / SATOSHI) >> halvings) * SATOSHI;
1498}
1499
1500CoinsViews::CoinsViews(DBParams db_params, CoinsViewOptions options)
1501 : m_dbview{std::move(db_params), std::move(options)},

Callers 10

ConnectBlockMethod · 0.85
ConnectTipMethod · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
TestBlockSubsidyHalvingsFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
WriteBlockMethod · 0.85
ReverseBlockMethod · 0.85
getblockstatsFunction · 0.85
DuplicateInputsFunction · 0.85
CreateNewBlockMethod · 0.85

Calls

no outgoing calls

Tested by 3

BOOST_AUTO_TEST_CASEFunction · 0.68
TestBlockSubsidyHalvingsFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68