diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -5165,8 +5165,10 @@ return 0; } - return std::max(0, (COINBASE_MATURITY + 1) - - GetDepthInMainChain(locked_chain)); + int chain_depth = GetDepthInMainChain(locked_chain); + // coinbase tx should not be conflicted + assert(chain_depth >= 0); + return std::max(0, (COINBASE_MATURITY + 1) - chain_depth); } bool CMerkleTx::IsImmatureCoinBase(