Skip to content

Commit 3bee5f6

Browse files
committed
Merge pull request #50 from 'fix/fix-bdk-tx-version'
2 parents b9a4fb7 + a2638ce commit 3bee5f6

3 files changed

Lines changed: 19 additions & 15 deletions

File tree

Cargo.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/v2/src/main.rs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -653,30 +653,32 @@ async fn main() -> anyhow::Result<()> {
653653

654654
let (tip_height, tip_time) = wallet.tip_info();
655655
let longterm_feerate = FeeRate::from_sat_per_vb_unchecked(1);
656+
let change_placeholder_spk = wallet.get_change_address().get_placeholder_p2tr_spk();
657+
let change_min_value = change_placeholder_spk.minimal_non_dust().to_sat();
656658
let selection = wallet
657659
.all_candidates()
658660
.regroup(group_by_spk())
659661
.filter(filter_unspendable_now(tip_height, tip_time))
660662
.into_selection(
661663
selection_algorithm_lowest_fee_bnb(longterm_feerate, 100_000),
662664
SelectorParams::new(
663-
FeeRate::from_sat_per_vb_unchecked(fee_rate),
665+
bdk_tx::FeeStrategy::FeeRate(FeeRate::from_sat_per_vb_unchecked(fee_rate)),
664666
outputs,
665667
bdk_tx::ScriptSource::from_script(
666668
wallet.get_change_address().get_placeholder_p2tr_spk(),
667669
),
668-
bdk_tx::ChangePolicyType::NoDustAndLeastWaste { longterm_feerate },
669-
DrainWeights {
670-
output_weight: TxOut {
671-
script_pubkey: wallet
672-
.get_change_address()
673-
.get_placeholder_p2tr_spk(),
674-
value: Amount::ZERO,
675-
}
676-
.weight()
677-
.to_wu(),
678-
spend_weight: SpWallet::DEFAULT_SPENDING_WEIGHT,
679-
n_outputs: 1,
670+
bdk_coin_select::ChangePolicy {
671+
min_value: change_min_value,
672+
drain_weights: DrainWeights {
673+
output_weight: TxOut {
674+
script_pubkey: change_placeholder_spk,
675+
value: Amount::ZERO,
676+
}
677+
.weight()
678+
.to_wu(),
679+
spend_weight: SpWallet::DEFAULT_SPENDING_WEIGHT,
680+
n_outputs: 1,
681+
},
680682
},
681683
),
682684
)?;

wallet/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors.workspace = true
66

77
[dependencies]
88
bdk_sp = { version = "0.1.0", path = "../silentpayments" }
9-
bdk_tx = { version = "0.1.0", git = "https://github.com/bitcoindevkit/bdk-tx", branch = "master" }
9+
bdk_tx = { version = "0.1.0", git = "https://github.com/bitcoindevkit/bdk-tx", rev = "8d201770ffc81f89d4d3ae92c362f9f936ad5958" }
1010
indexer = { version = "0.1.0", path = "../indexer" , features = ["serde"]}
1111
serde = { version = "1.0.219", optional = true }
1212

0 commit comments

Comments
 (0)