You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i mostly having a problem when i want to send "max amount from address"
Inputs from coinselect are always undefined because the fee is calculated on top of the target amount, and then I don't have enough satoshi in inputs to send "max target amount + fee"
To give an example, we have 100,000 satoshi on address, and we want to send all, so in target value we set 100,000 sat. and feerate 100 sat.
Fee is then calculated to be 24,000 sat, and by coinselect algorithm, i need 124,000 sat on the address to send 100,000.
What we need is that coinselect return output value of 76,000 and fee of 24,000. So when Transaction is built, 100% of satoshi is used, leaving an address with 0 balance.
Is this possible to do using coin select, or we need some kind of workaround for this
Thank you.
The text was updated successfully, but these errors were encountered:
Pro-tip: if you want to send-all inputs to an output address, coinselect/split with a partial output (.address defined, no .value) can be used to send-all, while leaving an appropriate amount for the fee.
This should do what you need it to do..
This will sweep all inputs, to the specified output address (minus the fee)
@ac0uk while this works and sends the entire input, it sometimes breaks the outputs to two for me with a very random logic. any idea why this is happening? There is no point in creating two outputs which results in paying higher fees.
Hi, i mostly having a problem when i want to send "max amount from address"
Inputs from coinselect are always undefined because the fee is calculated on top of the target amount, and then I don't have enough satoshi in inputs to send "max target amount + fee"
To give an example, we have 100,000 satoshi on address, and we want to send all, so in target value we set 100,000 sat. and feerate 100 sat.
Fee is then calculated to be 24,000 sat, and by coinselect algorithm, i need 124,000 sat on the address to send 100,000.
What we need is that coinselect return output value of 76,000 and fee of 24,000. So when Transaction is built, 100% of satoshi is used, leaving an address with 0 balance.
Is this possible to do using coin select, or we need some kind of workaround for this
Thank you.
The text was updated successfully, but these errors were encountered: