]> Untitled Git - bdk/commitdiff
doc(bdk): Clarify the absolute_fee docs
authorDaniela Brozzoni <danielabrozzoni@protonmail.com>
Mon, 9 Oct 2023 10:22:42 +0000 (12:22 +0200)
committerSteve Myers <steve@notmandatory.org>
Tue, 22 Oct 2024 01:38:44 +0000 (20:38 -0500)
Fixes #1066

src/wallet/tx_builder.rs

index 16488ac2adadee75b08495a6a480eb99e23df933..9ce101217844ca1fd5c27c87070c00d1f8457d80 100644 (file)
@@ -189,6 +189,16 @@ impl<'a, D: BatchDatabase, Cs: CoinSelectionAlgorithm<D>, 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