CoinSelectionSimulator icon indicating copy to clipboard operation
CoinSelectionSimulator copied to clipboard

Letting wallets to define failure

Open karelbilek opened this issue 8 years ago • 2 comments

Instead of guarding insufficient value in simulator, lets wallets themselves define insufficient funds in selectCoins by returning None

I needed to tear apart selectCoins and spend for this.

TODO: measuring time. I was too lazy to do this

karelbilek avatar Jul 16 '17 21:07 karelbilek

The result is that the wallets are spending utxos sooner, since I removed the (outgoingPaymentsQueue.front.value * (-1) + 2 * WalletConstants.CENT) < currentLowestBalance) from most wallets (it's still in the wallets that I don't understand how they work :D).

The results are slightly worse and I am not sure why. I think it's because they are spening utxos sooner, the next transaction have utxo set with smaller utxos and that somehow hurt? Really, I am not sure at this point.

However it matches user's behavior more I think

Note that this PR is nor mergaeble at the same time as https://github.com/Xekyo/CoinSelectionSimulator/pull/11 ; whichever is merged first, the second will have to be edited :) I am still pushing it one PR at a time, so it's more clear what is hapenning

karelbilek avatar Jul 16 '17 21:07 karelbilek

This probably slows down the whole thing a bit too, but anyway, when combined with the other PR with "failure modes" it makes even more sense

karelbilek avatar Jul 17 '17 00:07 karelbilek