Skip to content

Commit 0ecc028

Browse files
doc(bdk): Clarify the absolute_fee, fee_rate docs
Fixes #1066
1 parent 2f2f138 commit 0ecc028

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

crates/bdk/src/wallet/tx_builder.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ impl<'a, D, Cs: CoinSelectionAlgorithm, Ctx: TxBuilderContext> TxBuilder<'a, D,
188188
/// * btc/kvB (0.00001000 btc/kvB == 1 sats/vB) using FeeRate::from_btc_per_kvb
189189
/// * sats/kwu (250 sats/kwu == 1 sats/vB) using FeeRate::from_sat_per_kwu
190190
/// Default is 1 sat/vB (see min_relay_fee)
191+
///
192+
/// Note that this is really a minimum feerate -- it's possible to
193+
/// overshoot it slightly since adding a change output to drain the remaining
194+
/// excess might not be viable.
191195
pub fn fee_rate(&mut self, fee_rate: FeeRate) -> &mut Self {
192196
self.params.fee_policy = Some(FeePolicy::FeeRate(fee_rate));
193197
self
@@ -198,6 +202,10 @@ impl<'a, D, Cs: CoinSelectionAlgorithm, Ctx: TxBuilderContext> TxBuilder<'a, D,
198202
/// If anyone sets both the fee_absolute method and the fee_rate method,
199203
/// the FeePolicy enum will be set by whichever method was called last,
200204
/// as the FeeRate and FeeAmount are mutually exclusive.
205+
///
206+
/// Note that this is really a minimum absolute fee -- it's possible to
207+
/// overshoot it slightly since adding a change output to drain the remaining
208+
/// excess might not be viable.
201209
pub fn fee_absolute(&mut self, fee_amount: u64) -> &mut Self {
202210
self.params.fee_policy = Some(FeePolicy::FeeAmount(fee_amount));
203211
self

0 commit comments

Comments
 (0)