-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coin selection and fee warning #78
Comments
The way
Well, at the stage of calling To cut a long story short,
That's a fair point, and should be changed to
This is probably the hard concept to grasp, but there is no actual amount to select. It's simply a case of "scoop up inputs until you run out or go over the max threshold" - then those inputs are used to try and create a transaction. It's certainly less than ideal and I've had it on the todo for ages to give input selection a thorough going over to utilize heuristics such as count, size and age (since they directly affect mining priority) but it's not been high up the list sadly. So looping back round to the original issue, the return value (the amount we selected for inputs) is accurate, it's the estimation of how much we'll need for the fees that seems not to be.
Here
provides a result of 2600, an insufficient value. Thus I believe it's the calculation that needs fixing. I've tried to get some more specifics but sadly even with What we do know is that:
Now let's look at just sending a plain bitcoin transaction from that address using coin control and no custom values (payFee = 0), notice the fee required is almost 7000 satoshis and thus much higher than the available inputs? Long story short I agree we need to make the Hope that makes sense bud !! :) |
Ah, thanks for the details! My assumption was that Regarding the fee issue: the formula is sort of sound, and I put some thoughts into it, when we adopted this one, see: zathras-crypto#17 (comment).
|
Slightly related: The fee warning doesn't vanish, after BTC are sent to a "warned" address. |
Ahh yes, thanks for the reminder - need to re-add wallet model for those bits... |
#99 ensures the warnings are properly cleared, and it added a static fee warning threshold of 10K satoshi, which isn't ideal, but it resolves this issue. Improvements may be submitted in the future, but tracked via a new issue. /close |
To quote zathras-crypto#75:
Provides 2600 satoshi value for minWarn using default parameters (ie no relay or mining fee customization) on 0.0.10 (both testnet & mainnet). This is not sufficient however, as the cost to send a ~450 byte transaction was a touch over 6000 satoshi.
Results in no warning about low fees, but failure to send transaction.
Note to self, revisit how warning fee is calculated.
EDIT: for reminder - available inputs for mpZATHm5 were >2600 minWarn value but not sufficient to send a tx.
I further noticed, but please correct me, if I'm wrong, that the coin selection right now may select insufficient amounts.
In particular, selectCoins() appears to select coins, until
n_max <= n_total
is reached.n_total
is returned in any case.ClassAgnosticWalletTXBuilder() is used to construct transactions, and coins are selected as follows:
As far as I can see, this is flawed:
selectCoins()
returns at least 0.if (0 >= ...
, then it seems as if this still not sufficient, because the coin selection may as well end, before the actual amount to select is reached.The text was updated successfully, but these errors were encountered: