Skip to content

Commit

Permalink
doc(bdk): Clarify the absolute_fee docs
Browse files Browse the repository at this point in the history
  • Loading branch information
danielabrozzoni authored and notmandatory committed Oct 22, 2024
1 parent f13335e commit ca5726f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/wallet/tx_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ca5726f

Please sign in to comment.