-
Notifications
You must be signed in to change notification settings - Fork 115
Description
If I understand this correctly, I shouldn't rely on the fee value returned unless either inputs or outputs are returned? Here is from the README example:
// .inputs and .outputs will be undefined if no solution was found
if (!inputs || !outputs) return
There is only a single UTXO provided to the coinselect and it runs to the following line, which makes it continue out of the loop and go to the bottom where only fee is returned:
Line 22 in 1f7cd37
| if ((inAccum + inputValue) > (outAccum + fee + threshold)) continue |
That results in both inputs and outputs being empty, which are only supplied if finalize is ever called, which in the case you have a single UTXO that has enough for output and fee.
Line 34 in 1f7cd37
| return { fee: feeRate * bytesAccum } |
Is this expected behavior, that inputs and outputs will be empty in a scenario like this and is the example misleading, or do I have other issues with the provided input data?