diff --git a/bin/flo-qt b/bin/flo-qt index 51cf46c40..3756c0e21 100755 Binary files a/bin/flo-qt and b/bin/flo-qt differ diff --git a/bin/flod b/bin/flod index 090ca0bb4..38aced29b 100755 Binary files a/bin/flod and b/bin/flod differ diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index a144368fb..610f60bd0 100755 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2542,8 +2542,18 @@ bool CWallet::SelectCoins(const std::vector& vAvailableCoins, const CAm setCoinsRet.insert(setPresetCoins.begin(), setPresetCoins.end()); nValueRet = nValueFromPresetInputs; //return true if total preset input value is greater than required amount - if (nValueFromPresetInputs >= nTargetValue) + if (nValueFromPresetInputs >= nTargetValue){ + if(gArgs.GetBoolArg("-SendChangeToBack", false)){ + CAmount maxVal=0; + for (const CInputCoin &coin : setCoinsRet){ + if(coin.txout.nValue > maxVal){ + ExtractDestination(coin.txout.scriptPubKey, destChange); + maxVal = coin.txout.nValue; + } + } + } return true; + } //select UTXOs from vCoins and insert into setCoinsRet (returning set of selected utxo) until required amount is obtained CAmount nRemainReqValue = nTargetValue - nValueFromPresetInputs;