Skip to content

Commit f741122

Browse files
committedDec 5, 2023
Merge #1158: doc(bdk): Clarify the absolute_fee docs
0ecc028 doc(bdk): Clarify the absolute_fee, fee_rate docs (Daniela Brozzoni) Pull request description: Fixes #1066 ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing ACKs for top commit: notmandatory: ACK 0ecc028 Tree-SHA512: 152e48b86c21d4fad711abf76dd8fdc0e8955030331005c1ba6ff0c866c52870161f91ec740838f8238c5ad1c620e06212099308a55d130699cb18e4666e3f3f
2 parents 959b4f8 + 0ecc028 commit f741122

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎crates/bdk/src/wallet/tx_builder.rs

+8
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ impl<'a, D, Cs: CoinSelectionAlgorithm, Ctx: TxBuilderContext> TxBuilder<'a, D,
199199
/// * btc/kvB (0.00001000 btc/kvB == 1 sats/vB) using FeeRate::from_btc_per_kvb
200200
/// * sats/kwu (250 sats/kwu == 1 sats/vB) using FeeRate::from_sat_per_kwu
201201
/// Default is 1 sat/vB (see min_relay_fee)
202+
///
203+
/// Note that this is really a minimum feerate -- it's possible to
204+
/// overshoot it slightly since adding a change output to drain the remaining
205+
/// excess might not be viable.
202206
pub fn fee_rate(&mut self, fee_rate: FeeRate) -> &mut Self {
203207
self.params.fee_policy = Some(FeePolicy::FeeRate(fee_rate));
204208
self
@@ -209,6 +213,10 @@ impl<'a, D, Cs: CoinSelectionAlgorithm, Ctx: TxBuilderContext> TxBuilder<'a, D,
209213
/// If anyone sets both the fee_absolute method and the fee_rate method,
210214
/// the FeePolicy enum will be set by whichever method was called last,
211215
/// as the FeeRate and FeeAmount are mutually exclusive.
216+
///
217+
/// Note that this is really a minimum absolute fee -- it's possible to
218+
/// overshoot it slightly since adding a change output to drain the remaining
219+
/// excess might not be viable.
212220
pub fn fee_absolute(&mut self, fee_amount: u64) -> &mut Self {
213221
self.params.fee_policy = Some(FeePolicy::FeeAmount(fee_amount));
214222
self

0 commit comments

Comments
 (0)