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

Function GetBlockSubsidy

src/validation.cpp:1845–1856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1843}
1844
1845CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
1846{
1847 int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
1848 // Force block reward to zero when right shift is undefined.
1849 if (halvings >= 64)
1850 return 0;
1851
1852 CAmount nSubsidy = 50 * COIN;
1853 // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
1854 nSubsidy >>= halvings;
1855 return nSubsidy;
1856}
1857
1858CoinsViews::CoinsViews(DBParams db_params, CoinsViewOptions options)
1859 : m_dbview{std::move(db_params), std::move(options)},

Callers 9

ConnectBlockMethod · 0.85
TestBlockSubsidyHalvingsFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
FUZZ_TARGETFunction · 0.85
CreateBlockChainFunction · 0.85
CustomAppendMethod · 0.85
getblockstatsFunction · 0.85
DuplicateInputsFunction · 0.85
CreateNewBlockMethod · 0.85

Calls

no outgoing calls

Tested by 4

TestBlockSubsidyHalvingsFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
FUZZ_TARGETFunction · 0.68
CreateBlockChainFunction · 0.68