Skip to content

Commit

Permalink
allow selection of correct coinbase maturity value based on height
Browse files Browse the repository at this point in the history
  • Loading branch information
barrystyle committed Dec 30, 2023
1 parent 1c2c656 commit 844b7d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/consensus/tx_verify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ bool Consensus::CheckTxInputs(const CTransaction& tx, TxValidationState& state,
assert(!coin.IsSpent());

// If prev is coinbase, check that it's matured
if (coin.IsCoinBase() && nSpendHeight - coin.nHeight < COINBASE_MATURITY) {
if (coin.IsCoinBase() && nSpendHeight - coin.nHeight < (coin.nHeight < 145000 ? COINBASE_MATURITY : COINBASE_MATURITY_2)) {
return state.Invalid(TxValidationResult::TX_PREMATURE_SPEND, "bad-txns-premature-spend-of-coinbase",
strprintf("tried to spend coinbase at depth %d", nSpendHeight - coin.nHeight));
}
Expand Down

0 comments on commit 844b7d9

Please sign in to comment.