From 38a83007e827b4585e04f23f838bbf1eef4bf7a6 Mon Sep 17 00:00:00 2001 From: langerhans Date: Fri, 31 Jul 2015 21:23:27 +0200 Subject: Move COINBASE_MATURITY to the consensus parameters --- src/txmempool.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/txmempool.cpp') diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 1c16e2092..1502cc6d2 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -5,6 +5,7 @@ #include "txmempool.h" +#include "chainparams.h" #include "clientversion.h" #include "consensus/consensus.h" #include "consensus/validation.h" @@ -166,7 +167,8 @@ void CTxMemPool::removeCoinbaseSpends(const CCoinsViewCache *pcoins, unsigned in continue; const CCoins *coins = pcoins->AccessCoins(txin.prevout.hash); if (fSanityCheck) assert(coins); - if (!coins || (coins->IsCoinBase() && nMemPoolHeight - coins->nHeight < COINBASE_MATURITY)) { + int nCoinbaseMaturity = Params().GetConsensus(coins->nHeight).nCoinbaseMaturity; + if (!coins || (coins->IsCoinBase() && nMemPoolHeight - coins->nHeight < nCoinbaseMaturity)) { transactionsToRemove.push_back(tx); break; } -- cgit v1.2.3