Corrected block maturity test.

This commit is contained in:
Ross Nicoll 2014-04-20 11:39:21 +01:00 committed by Patrick Lodder
parent f21ed2c0b0
commit e1ce43df71

View file

@ -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());
}