Skip to content

Subtracting fee from output amount #41

@vladanm

Description

@vladanm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions