Skip to content

Commit ca5726f

Browse files
danielabrozzoninotmandatory
authored andcommitted
doc(bdk): Clarify the absolute_fee docs
Fixes bitcoindevkit#1066
1 parent f13335e commit ca5726f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/wallet/tx_builder.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,16 @@ impl<'a, D: BatchDatabase, Cs: CoinSelectionAlgorithm<D>, Ctx: TxBuilderContext>
189189
}
190190

191191
/// Set an absolute fee
192+
///
193+
/// The fee_absolute method refers to the absolute transaction fee in satoshis (sats).
194+
///
195+
/// If anyone sets both the [`fee_absolute`](TxBuilder::fee_absolute) method
196+
/// and the [`fee_rate`](TxBuilder::fee_rate) method, the fee policy will
197+
/// be set by whichever method was called last, as the two are mutually exclusive.
198+
///
199+
/// Note that this is really a minimum absolute fee -- it's possible to
200+
/// overshoot it slightly since adding a change output to drain the remaining
201+
/// excess might not be viable.
192202
pub fn fee_absolute(&mut self, fee_amount: u64) -> &mut Self {
193203
self.params.fee_policy = Some(FeePolicy::FeeAmount(fee_amount));
194204
self

0 commit comments

Comments
 (0)