Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 2,139 Lines • ▼ Show 20 Lines | bool CChainState::ConnectBlock(const CBlock &block, BlockValidationState &state, | ||||
if (block.vtx[0]->GetValueOut() > blockReward) { | if (block.vtx[0]->GetValueOut() > blockReward) { | ||||
LogPrintf("ERROR: ConnectBlock(): coinbase pays too much (actual=%d vs " | LogPrintf("ERROR: ConnectBlock(): coinbase pays too much (actual=%d vs " | ||||
"limit=%d)\n", | "limit=%d)\n", | ||||
block.vtx[0]->GetValueOut(), blockReward); | block.vtx[0]->GetValueOut(), blockReward); | ||||
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, | return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, | ||||
"bad-cb-amount"); | "bad-cb-amount"); | ||||
} | } | ||||
const std::vector<CTxDestination> whitelist = | const auto whitelist = | ||||
GetMinerFundWhitelist(consensusParams, pindex->pprev); | GetMinerFundWhitelist(consensusParams, pindex->pprev); | ||||
if (!whitelist.empty()) { | if (!whitelist.empty()) { | ||||
const Amount required = GetMinerFundAmount(blockReward); | const Amount required = GetMinerFundAmount(blockReward); | ||||
for (auto &o : block.vtx[0]->vout) { | for (auto &o : block.vtx[0]->vout) { | ||||
if (o.nValue < required) { | if (o.nValue < required) { | ||||
// This output doesn't qualify because its amount is too low. | // This output doesn't qualify because its amount is too low. | ||||
continue; | continue; | ||||
▲ Show 20 Lines • Show All 3,944 Lines • Show Last 20 Lines |