Skip to content

Commit 7b35e20

Browse files
committed
fix: added the missing 4 WU
1 parent 1ef9095 commit 7b35e20

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};
@@ -1288,7 +1288,7 @@ impl<D> Wallet<D> {
12881288
let satisfaction_weight = self
12891289
.get_descriptor_for_keychain(keychain)
12901290
.max_weight_to_satisfy()
1291-
.unwrap();
1291+
.unwrap() + 4;
12921292
WeightedUtxo {
12931293
utxo: Utxo::Local(LocalUtxo {
12941294
outpoint: txin.previous_output,
@@ -1298,7 +1298,7 @@ impl<D> Wallet<D> {
12981298
derivation_index,
12991299
confirmation_time,
13001300
}),
1301-
satisfaction_weight,
1301+
satisfaction_weight
13021302
}
13031303
}
13041304
None => {
@@ -1621,7 +1621,7 @@ impl<D> Wallet<D> {
16211621
utxo,
16221622
self.get_descriptor_for_keychain(keychain)
16231623
.max_weight_to_satisfy()
1624-
.unwrap(),
1624+
.unwrap() + 4,
16251625
)
16261626
})
16271627
.collect()

crates/bdk/src/wallet/tx_builder.rs

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

296296
for utxo in utxos {
297297
let descriptor = wallet.get_descriptor_for_keychain(utxo.keychain);
298-
let satisfaction_weight = descriptor.max_weight_to_satisfy().unwrap();
298+
let satisfaction_weight = descriptor.max_weight_to_satisfy().unwrap() + 4;
299299
self.params.utxos.push(WeightedUtxo {
300300
satisfaction_weight,
301301
utxo: Utxo::Local(utxo),

0 commit comments

Comments
 (0)