From e1ce43df71b751e84886ae5b8f4e4a88cf1aa76a Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Sun, 20 Apr 2014 11:39:21 +0100 Subject: [PATCH] Corrected block maturity test. --- src/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index b5302a9bf..dac145148 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -936,7 +936,11 @@ int CMerkleTx::GetBlocksToMaturity() const { if (!IsCoinBase()) return 0; - return max(0, (COINBASE_MATURITY+1) - GetDepthInMainChain()); + + if(GetDepthInMainChain() >= COINBASE_MATURITY_SWITCH) + return max(0, (COINBASE_MATURITY_NEW+20) - GetDepthInMainChain()); + else + return max(0, (COINBASE_MATURITY+20) - GetDepthInMainChain()); }