Skip to content

Commit fbf803a

Browse files
committed
Merge #422: docs(wallet): fix misleading RBF comment in create_tx
76a8cc6 docs(wallet): fix misleading RBF comment in `create_tx` (Vadim Anufriev) Pull request description: ### Description Fix misleading comment in `create_tx` regarding empty tx output logic. This addresses a documentation nitpick brought up by the 2024 [WizardSardine report](https://bitcoindevkit.org/audits/2024_q4/bdk_audit_report). - Replaced incorrect RBF example with sweeping UTXOs - Reordered comment items to match the code's condition order Closes #45 ### Changelog notice Fixed: - Fix docs for `Wallet:create_tx` when empty output vector ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `just p` before pushing ACKs for top commit: luisschwab: ACK 76a8cc6 Tree-SHA512: 6a788ffafbf195da2b6ef39b605319aec480dea8896dedc38a0244e3902e7f697611725ddfe81ca25204916802b4a6c5784d96ee1e78d21a003acdd3d8ef081f
2 parents f5a4c38 + 76a8cc6 commit fbf803a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/wallet/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,10 +1492,10 @@ impl Wallet {
14921492

14931493
if tx.output.is_empty() {
14941494
// Uh oh, our transaction has no outputs.
1495-
// We allow this when:
1496-
// - We have a drain_to address and the utxos we must spend (this happens,
1497-
// for example, when we RBF).
1498-
// - We have a drain_to address and drain_wallet set.
1495+
// We allow this when we have a `drain_to` address and either:
1496+
// - `drain_wallet` is enabled
1497+
// - there are UTXOs we must spend (this happens, for example, when
1498+
// sweeping specific UTXOs to a given address)
14991499
// Otherwise, we don't know who we should send the funds to, and how much
15001500
// we should send!
15011501
if params.drain_to.is_some() && (params.drain_wallet || !params.utxos.is_empty()) {

0 commit comments

Comments
 (0)