Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2148,12 +2148,12 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state,

nBlocksTotal++;

// Check that all non-zero coinbase outputs pay to the required destination
// Check that all non-zero policyAsset coinbase outputs pay to the required destination
const CScript& mandatory_coinbase_destination = m_params.GetConsensus().mandatory_coinbase_destination;
if (mandatory_coinbase_destination != CScript()) {
for (auto& txout : block.vtx[0]->vout) {
bool mustPay = !txout.nValue.IsExplicit() || txout.nValue.GetAmount() != 0;
if (mustPay && txout.scriptPubKey != mandatory_coinbase_destination) {
if (mustPay && txout.nAsset.GetAsset() == policyAsset && txout.scriptPubKey != mandatory_coinbase_destination) {
LogPrintf("ERROR: ConnectBlock(): Coinbase outputs didn't match required scriptPubKey\n");
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-coinbase-txos");
}
Expand Down