MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetBlockSubsidy

Function GetBlockSubsidy

src/validation.cpp:1510–1521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1508}
1509
1510CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
1511{
1512 int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
1513 // Force block reward to zero when right shift is undefined.
1514 if (halvings >= 64)
1515 return 0;
1516
1517 CAmount nSubsidy = consensusParams.genesis_subsidy;
1518 // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
1519 nSubsidy >>= halvings;
1520 return nSubsidy;
1521}
1522
1523CoinsViews::CoinsViews(
1524 std::string ldb_name,

Callers 9

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

Calls

no outgoing calls

Tested by 3

TestBlockSubsidyHalvingsFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
CreateBlockChainFunction · 0.68