Skip to content

Commit e9ed354

Browse files
authored
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.
1 parent 4b6af8f commit e9ed354

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/wallet/wallet.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2961,8 +2961,6 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, const int nConfMin
29612961
std::sort(vCoins.begin(), vCoins.end(), less_then_denom);
29622962
}
29632963

2964-
int nMaxChainLength = std::min(gArgs.GetArg("-limitancestorcount", DEFAULT_ANCESTOR_LIMIT), gArgs.GetArg("-limitdescendantcount", DEFAULT_DESCENDANT_LIMIT));
2965-
29662964
// try to find nondenom first to prevent unneeded spending of mixed coins
29672965
for (unsigned int tryDenom = tryDenomStart; tryDenom < 2; tryDenom++)
29682966
{
@@ -2982,7 +2980,7 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, const int nConfMin
29822980
if (output.nDepth < (pcoin->IsFromMe(ISMINE_ALL) ? nConfMine : nConfTheirs) && !fLockedByIS)
29832981
continue;
29842982

2985-
if (!mempool.TransactionWithinChainLimit(pcoin->GetHash(), fLockedByIS ? nMaxChainLength : nMaxAncestors))
2983+
if (!mempool.TransactionWithinChainLimit(pcoin->GetHash(), nMaxAncestors))
29862984
continue;
29872985

29882986
int i = output.i;

0 commit comments

Comments
 (0)