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/auxpow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/auxpow.cpp') diff --git a/src/auxpow.cpp b/src/auxpow.cpp index 3c350a67a..7356d0202 100644 --- a/src/auxpow.cpp +++ b/src/auxpow.cpp @@ -7,6 +7,7 @@ #include "auxpow.h" +#include "chainparams.h" #include "consensus/validation.h" #include "main.h" #include "script/script.h" @@ -89,7 +90,8 @@ int CMerkleTx::GetBlocksToMaturity() const { if (!IsCoinBase()) return 0; - return std::max(0, (COINBASE_MATURITY + 1) - GetDepthInMainChain()); + int nCoinbaseMaturity = Params().GetConsensus(chainActive.Height()).nCoinbaseMaturity; + return std::max(0, (nCoinbaseMaturity + 1) - GetDepthInMainChain()); } -- cgit v1.2.3