firoorg / firo

The privacy-focused cryptocurrency
https://firo.org
MIT License
720 stars 354 forks source link

Fix coin selection bug #1203

Closed levonpetrosyan93 closed 2 years ago

levonpetrosyan93 commented 2 years ago

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.

lgtm-com[bot] commented 2 years ago

This pull request fixes 3 alerts when merging 3646141950cde018e35c703388a399341a05ce5e into 57d270122fbd9907837f06581b911e69c9524c9c - view on LGTM.com

fixed alerts: