]> Untitled Git - bdk/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)
commit36c5a4dc0c7864573ed98bb5da120838eafe540c
tree24cdb3c7103916f4480321dd48756b6ca73529bd
parentf67bfe7bfc0d16a44cd11e16dc950abf002e6332
[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
src/error.rs
src/wallet/mod.rs
src/wallet/tx_builder.rs