PR fixed the corner case issue when it showsTransaction too large error on big wallets.
The issue happens when all coins in the wallet are smaller then required value and coin selection has to run subset sum algorithm. In that case it returns all coins wallet has and if wallet has a lot of coins, tx size it too large and transaction creation fails.
This happens as bool fForUseInInstantSend is passed in place of iterations to the function ApproximateBestSubset.
If that bool is false, the algorithm is not running, it just returns the whole set of coins.
This pull request fixes 3 alerts when merging 3646141950cde018e35c703388a399341a05ce5e into 57d270122fbd9907837f06581b911e69c9524c9c - view on LGTM.com
PR fixed the corner case issue when it shows
Transaction too large error
on big wallets.The issue happens when all coins in the wallet are smaller then required value and coin selection has to run subset sum algorithm. In that case it returns all coins wallet has and if wallet has a lot of coins, tx size it too large and transaction creation fails. This happens as bool
fForUseInInstantSend
is passed in place ofiterations
to the functionApproximateBestSubset
. If that bool is false, the algorithm is not running, it just returns the whole set of coins.