mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +01:00
ignore IX confirmations when forming new tx
This commit is contained in:
parent
b1d701275a
commit
1377b71347
10
src/main.cpp
10
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;
|
||||
|
@ -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);
|
||||
|
@ -1249,7 +1249,7 @@ void CWallet::AvailableCoins(vector<COutput>& 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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user