Skip to content

Commit 46c7be0

Browse files
committed
fix: added the missing 4 WU
1 parent 12f4414 commit 46c7be0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

crates/bdk/src/wallet/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ use bdk_chain::{
2828
Append, BlockId, ChainPosition, ConfirmationTime, ConfirmationTimeAnchor, FullTxOut,
2929
IndexedTxGraph, Persist, PersistBackend,
3030
};
31-
use bitcoin::consensus::encode::serialize;
3231
use bitcoin::psbt;
3332
use bitcoin::secp256k1::Secp256k1;
3433
use bitcoin::sighash::{EcdsaSighashType, TapSighashType};
3534
use bitcoin::{
3635
absolute, Address, Network, OutPoint, Script, ScriptBuf, Sequence, Transaction, TxOut, Txid,
3736
Weight, Witness,
3837
};
38+
use bitcoin::consensus::encode::serialize;
3939
use core::fmt;
4040
use core::ops::Deref;
4141
use miniscript::psbt::{PsbtExt, PsbtInputExt, PsbtInputSatisfier};
@@ -1225,7 +1225,7 @@ impl<D> Wallet<D> {
12251225
let satisfaction_weight = self
12261226
.get_descriptor_for_keychain(keychain)
12271227
.max_weight_to_satisfy()
1228-
.unwrap();
1228+
.unwrap() + 4;
12291229
WeightedUtxo {
12301230
utxo: Utxo::Local(LocalUtxo {
12311231
outpoint: txin.previous_output,
@@ -1235,7 +1235,7 @@ impl<D> Wallet<D> {
12351235
derivation_index,
12361236
confirmation_time,
12371237
}),
1238-
satisfaction_weight,
1238+
satisfaction_weight
12391239
}
12401240
}
12411241
None => {
@@ -1558,7 +1558,7 @@ impl<D> Wallet<D> {
15581558
utxo,
15591559
self.get_descriptor_for_keychain(keychain)
15601560
.max_weight_to_satisfy()
1561-
.unwrap(),
1561+
.unwrap() + 4,
15621562
)
15631563
})
15641564
.collect()

crates/bdk/src/wallet/tx_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ impl<'a, D, Cs: CoinSelectionAlgorithm, Ctx: TxBuilderContext> TxBuilder<'a, D,
287287

288288
for utxo in utxos {
289289
let descriptor = wallet.get_descriptor_for_keychain(utxo.keychain);
290-
let satisfaction_weight = descriptor.max_weight_to_satisfy().unwrap();
290+
let satisfaction_weight = descriptor.max_weight_to_satisfy().unwrap() + 4;
291291
self.params.utxos.push(WeightedUtxo {
292292
satisfaction_weight,
293293
utxo: Utxo::Local(utxo),

0 commit comments

Comments
 (0)