Skip to content

Commit bd4b6aa

Browse files
committed
f Account for new OutputSpendingFee confirmation target
1 parent f653565 commit bd4b6aa

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/fee_estimator.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ where
4242
ConfirmationTarget::AnchorChannelFee,
4343
ConfirmationTarget::NonAnchorChannelFee,
4444
ConfirmationTarget::ChannelCloseMinimum,
45+
ConfirmationTarget::OutputSpendingFee,
4546
];
4647
for target in confirmation_targets {
4748
let num_blocks = match target {
@@ -51,6 +52,7 @@ where
5152
ConfirmationTarget::AnchorChannelFee => 1008,
5253
ConfirmationTarget::NonAnchorChannelFee => 12,
5354
ConfirmationTarget::ChannelCloseMinimum => 144,
55+
ConfirmationTarget::OutputSpendingFee => 12,
5456
};
5557

5658
let estimates = self.esplora_client.get_fee_estimates().await.map_err(|e| {
@@ -119,6 +121,7 @@ where
119121
ConfirmationTarget::AnchorChannelFee => 500,
120122
ConfirmationTarget::NonAnchorChannelFee => 1000,
121123
ConfirmationTarget::ChannelCloseMinimum => 500,
124+
ConfirmationTarget::OutputSpendingFee => 1000,
122125
};
123126

124127
// We'll fall back on this, if we really don't have any other information.

src/sweep.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ where
314314
&self, output_descriptors: &Vec<SpendableOutputDescriptor>, cur_height: u32,
315315
) -> Result<Transaction, ()> {
316316
let tx_feerate =
317-
self.fee_estimator.get_est_sat_per_1000_weight(ConfirmationTarget::NonAnchorChannelFee);
317+
self.fee_estimator.get_est_sat_per_1000_weight(ConfirmationTarget::OutputSpendingFee);
318318

319319
let destination_address = self.wallet.get_new_address().map_err(|e| {
320320
log_error!(self.logger, "Failed to get destination address from wallet: {}", e);

src/wallet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ where
173173
pub(crate) fn send_to_address(
174174
&self, address: &bitcoin::Address, amount_msat_or_drain: Option<u64>,
175175
) -> Result<Txid, Error> {
176-
let confirmation_target = ConfirmationTarget::NonAnchorChannelFee;
176+
let confirmation_target = ConfirmationTarget::OutputSpendingFee;
177177
let fee_rate = FeeRate::from_sat_per_kwu(
178178
self.fee_estimator.get_est_sat_per_1000_weight(confirmation_target) as f32,
179179
);

0 commit comments

Comments
 (0)