From: Daniela Brozzoni Date: Mon, 9 Oct 2023 10:22:42 +0000 (+0200) Subject: doc(bdk): Clarify the absolute_fee docs X-Git-Tag: v0.30.0~3 X-Git-Url: http://internal-gitweb-vhost/?a=commitdiff_plain;h=ca5726f1d41d1deb85dcf4763add6ce3a2874cf5;p=bdk doc(bdk): Clarify the absolute_fee docs Fixes #1066 --- diff --git a/src/wallet/tx_builder.rs b/src/wallet/tx_builder.rs index 16488ac2..9ce10121 100644 --- a/src/wallet/tx_builder.rs +++ b/src/wallet/tx_builder.rs @@ -189,6 +189,16 @@ impl<'a, D: BatchDatabase, Cs: CoinSelectionAlgorithm, Ctx: TxBuilderContext> } /// Set an absolute fee + /// + /// The fee_absolute method refers to the absolute transaction fee in satoshis (sats). + /// + /// If anyone sets both the [`fee_absolute`](TxBuilder::fee_absolute) method + /// and the [`fee_rate`](TxBuilder::fee_rate) method, the fee policy will + /// be set by whichever method was called last, as the two are mutually exclusive. + /// + /// Note that this is really a minimum absolute fee -- it's possible to + /// overshoot it slightly since adding a change output to drain the remaining + /// excess might not be viable. pub fn fee_absolute(&mut self, fee_amount: u64) -> &mut Self { self.params.fee_policy = Some(FeePolicy::FeeAmount(fee_amount)); self