From 844b7d92ca9e476e813e3ad47119286311292447 Mon Sep 17 00:00:00 2001 From: barrystyle Date: Sun, 31 Dec 2023 00:12:43 +0800 Subject: [PATCH] allow selection of correct coinbase maturity value based on height --- src/consensus/tx_verify.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/consensus/tx_verify.cpp b/src/consensus/tx_verify.cpp index 3923957e70..3ff710c679 100644 --- a/src/consensus/tx_verify.cpp +++ b/src/consensus/tx_verify.cpp @@ -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)); }