diff --git a/src/main.cpp b/src/main.cpp index 804287743a..a2b183a20a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1179,16 +1179,18 @@ int CMerkleTx::IsTransactionLocked() const return 0; } -int CMerkleTx::GetDepthInMainChain(CBlockIndex* &pindexRet) const +int CMerkleTx::GetDepthInMainChain(CBlockIndex* &pindexRet, bool enableIX) const { AssertLockHeld(cs_main); int nResult = GetDepthInMainChainINTERNAL(pindexRet); if (nResult == 0 && !mempool.exists(GetHash())) return -1; // Not in chain, not in mempool - if (nResult < 6){ - int minConfirms = IsTransactionLocked(); - return minConfirms+nResult; + if(enableIX){ + if (nResult < 6){ + int minConfirms = IsTransactionLocked(); + return minConfirms+nResult; + } } return nResult; diff --git a/src/main.h b/src/main.h index afcb92adc6..c210cc4579 100644 --- a/src/main.h +++ b/src/main.h @@ -480,8 +480,8 @@ public: // -1 : not in blockchain, and not in memory pool (conflicted transaction) // 0 : in memory pool, waiting to be included in a block // >=1 : this many blocks deep in the main chain - int GetDepthInMainChain(CBlockIndex* &pindexRet) const; - int GetDepthInMainChain() const { CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet); } + int GetDepthInMainChain(CBlockIndex* &pindexRet, bool enableIX=true) const; + int GetDepthInMainChain(bool enableIX=true) const { CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet, enableIX); } bool IsInMainChain() const { CBlockIndex *pindexRet; return GetDepthInMainChainINTERNAL(pindexRet) > 0; } int GetBlocksToMaturity() const; bool AcceptToMemoryPool(bool fLimitFree=true); diff --git a/src/wallet.cpp b/src/wallet.cpp index ae48a4e562..e082ead7a5 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1249,7 +1249,7 @@ void CWallet::AvailableCoins(vector& vCoins, bool fOnlyConfirmed, const if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0) continue; - int nDepth = pcoin->GetDepthInMainChain(); + int nDepth = pcoin->GetDepthInMainChain(false); if (nDepth < minimum_confirmations) continue;