From 4fea2ce46877fdf754dc9e22d1e8b3830f5919bd Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Sat, 29 May 2021 09:32:55 +0100 Subject: Add Dogecoin block subsidies --- src/test/validation_block_tests.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/test/validation_block_tests.cpp') diff --git a/src/test/validation_block_tests.cpp b/src/test/validation_block_tests.cpp index ea17cb50f..a32b25899 100644 --- a/src/test/validation_block_tests.cpp +++ b/src/test/validation_block_tests.cpp @@ -85,7 +85,10 @@ std::shared_ptr MinerTestingSetup::Block(const uint256& prev_hash) CMutableTransaction txCoinbase(*pblock->vtx[0]); txCoinbase.vout.resize(2); txCoinbase.vout[1].scriptPubKey = pubKey; - txCoinbase.vout[1].nValue = txCoinbase.vout[0].nValue; + // Dogecoin: Override the calculated reward with a fixed value we know is going to be safe for every block. + // We need this as the blocks are not added to the chain as they're built, and as such the random subsidy + // calculation uses an incorrect previous block hash. + txCoinbase.vout[1].nValue = 10000 * COIN; txCoinbase.vout[0].nValue = 0; txCoinbase.vin[0].scriptWitness.SetNull(); pblock->vtx[0] = MakeTransactionRef(std::move(txCoinbase)); -- cgit v1.2.3