MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / GetBlockSubsidy

Function GetBlockSubsidy

src/main.cpp:1620–1631  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1618}
1619
1620CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
1621{
1622 int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
1623 // Force block reward to zero when right shift is undefined.
1624 if (halvings >= 64)
1625 return 0;
1626
1627 CAmount nSubsidy = 50 * COIN;
1628 // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
1629 nSubsidy >>= halvings;
1630 return nSubsidy;
1631}
1632
1633bool fForceInitialBlockDownload = false;
1634bool IsInitialBlockDownload()

Callers 4

CreateNewBlockFunction · 0.85
ConnectBlockFunction · 0.85
TestBlockSubsidyHalvingsFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestBlockSubsidyHalvingsFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68