mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
Partially revert 3061 (#3150)
Turned out that this causes SelectCoinsMinConf to (unnecessary) lean towards selecting mempool txes which can cause "too long mempool chain" error even when there are more funds to spend.
This commit is contained in:
parent
c74f2cd8b2
commit
75fddde67f
@ -2677,8 +2677,6 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, const int nConfMin
|
||||
std::sort(vCoins.begin(), vCoins.end(), less_then_denom);
|
||||
}
|
||||
|
||||
int nMaxChainLength = std::min(gArgs.GetArg("-limitancestorcount", DEFAULT_ANCESTOR_LIMIT), gArgs.GetArg("-limitdescendantcount", DEFAULT_DESCENDANT_LIMIT));
|
||||
|
||||
// try to find nondenom first to prevent unneeded spending of mixed coins
|
||||
for (unsigned int tryDenom = tryDenomStart; tryDenom < 2; tryDenom++)
|
||||
{
|
||||
@ -2698,7 +2696,7 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, const int nConfMin
|
||||
if (output.nDepth < (pcoin->IsFromMe(ISMINE_ALL) ? nConfMine : nConfTheirs) && !fLockedByIS)
|
||||
continue;
|
||||
|
||||
if (!mempool.TransactionWithinChainLimit(pcoin->GetHash(), fLockedByIS ? nMaxChainLength : nMaxAncestors))
|
||||
if (!mempool.TransactionWithinChainLimit(pcoin->GetHash(), nMaxAncestors))
|
||||
continue;
|
||||
|
||||
int i = output.i;
|
||||
|
Loading…
Reference in New Issue
Block a user