Skip to content

Commit 322cdcc

Browse files
committed
fix: add notes about the new max_weight_to_satisfy
1 parent 46c7be0 commit 322cdcc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/bdk/src/wallet/tx_builder.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,12 @@ impl<'a, D, Cs: CoinSelectionAlgorithm, Ctx: TxBuilderContext> TxBuilder<'a, D,
328328
/// causing you to pay a fee that is too high. The party who is broadcasting the transaction can
329329
/// of course check the real input weight matches the expected weight prior to broadcasting.
330330
///
331-
/// TODO: add notes about the new `max_weight_to_satisfy`
332331
/// To guarantee the `max_weight_to_satisfy` is correct, you can require the party providing the
333332
/// `psbt_input` provide a miniscript descriptor for the input so you can check it against the
334333
/// `script_pubkey` and then ask it for the [`max_weight_to_satisfy`].
334+
/// Be aware that `max_weight_to_satisfy` uses `segwit_weight` instead of `legacy_weight`,
335+
/// if you want to include only legacy inputs in your transaction, you should remove 1WU
336+
/// from each input's `max_weight_to_satisfy` for a more accurate estimate.
335337
///
336338
/// This is an **EXPERIMENTAL** feature, API and other major changes are expected.
337339
///

0 commit comments

Comments
 (0)