mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +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
4b6af8f2c1
commit
e9ed354822
@ -2961,8 +2961,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++)
|
||||
{
|
||||
@ -2982,7 +2980,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