Skip to content

Commit

Permalink
Fix coin selection bug
Browse files Browse the repository at this point in the history
  • Loading branch information
levonpetrosyan93 committed Sep 12, 2022
1 parent 57d2701 commit 3646141
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3840,9 +3840,9 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, const int nConfMin
std::vector<char> vfBest;
CAmount nBest;

ApproximateBestSubset(vValue, nTotalLower, nTargetValue, vfBest, nBest, fForUseInInstantSend);
ApproximateBestSubset(vValue, nTotalLower, nTargetValue, vfBest, nBest);
if (nBest != nTargetValue && nTotalLower >= nTargetValue + MIN_CHANGE)
ApproximateBestSubset(vValue, nTotalLower, nTargetValue + MIN_CHANGE, vfBest, nBest, fForUseInInstantSend);
ApproximateBestSubset(vValue, nTotalLower, nTargetValue + MIN_CHANGE, vfBest, nBest);

// If we have a bigger coin and (either the stochastic approximation didn't find a good solution,
// or the next bigger coin is closer), return the bigger coin
Expand Down

0 comments on commit 3646141

Please sign in to comment.