Skip to content

Commit b543259

Browse files
author
Tom Trevethan
committed
apply mandatory coinbase only to policyAsset
1 parent 9f1cc94 commit b543259

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/validation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2148,12 +2148,12 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state,
21482148

21492149
nBlocksTotal++;
21502150

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

0 commit comments

Comments
 (0)