Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only sync UTXOs owned by the wallet #2211

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions crates/ln-dlc-node/src/on_chain_wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,15 @@ impl<D> OnChainWallet<D> {
.map(|tx| tx.tx_node.txid)
.collect();

// We must watch every UTXO we own (until it is spent).
let indexed_outpoints = bdk.spk_index().outpoints().iter().cloned();
let utxos = bdk
.tx_graph()
.all_txouts()
.map(|(outpoint, _)| outpoint)
.filter_chain_unspents(
&local_chain,
local_chain.tip().block_id(),
indexed_outpoints,
)
.map(|(_, utxo)| utxo.outpoint)
.collect();

(
Expand Down