]> Untitled Git - bdk-cli/commit
[wallet] Split `send_all` into `set_single_recipient` and `drain_wallet`
authorAlekos Filini <alekos.filini@gmail.com>
Wed, 28 Oct 2020 09:37:47 +0000 (10:37 +0100)
committerAlekos Filini <alekos.filini@gmail.com>
Thu, 5 Nov 2020 11:06:43 +0000 (12:06 +0100)
commitf587c3bee499baa32421a6c20e96cbddac8bc173
tree8d2f3107ab17fc931bd307148372a7f32eb370d4
parentcbb677333cdebe41fe73b8e42ca1840b7e5405ef
[wallet] Split `send_all` into `set_single_recipient` and `drain_wallet`

Previously `send_all` was particularly confusing, because when used on a
`create_tx` it implied two things:
- spend everything that's in the wallet (if no utxos are specified)
- don't create a change output

But when used on a `bump_fee` it only meant to not add a change output
and instead reduce the only existing output to increase the fee.

This has now been split into two separate options that should hopefully
make it more clear to use, as described in #142.

Additionally, `TxBuilder` now has a "context", that basically allows to
make some flags available only when they are actually meaningful, either
for `create_tx` or `bump_fee`.

Closes #142.
src/cli.rs