Skip to content

Commit a6c0b40

Browse files
committed
f Use HashSet
1 parent 9bee392 commit a6c0b40

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/access.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use bdk::{SignOptions, SyncOptions};
1616

1717
use bitcoin::{BlockHash, Script, Transaction, Txid};
1818

19+
use std::collections::HashSet;
1920
use std::sync::{Arc, Mutex};
2021

2122
/// The minimum feerate we are allowed to send, as specify by LDK.
@@ -101,15 +102,12 @@ where
101102

102103
// Check in the current queue, as well as in registered transactions leftover from
103104
// previous iterations.
104-
let mut registered_txs: Vec<Txid> = locked_watched_transactions
105+
let registered_txs: HashSet<Txid> = locked_watched_transactions
105106
.iter()
106107
.chain(locked_queued_transactions.iter())
107108
.cloned()
108109
.collect();
109110

110-
registered_txs.sort_unstable_by(|txid1, txid2| txid1.cmp(&txid2));
111-
registered_txs.dedup_by(|txid1, txid2| txid1.eq(&txid2));
112-
113111
// Remember all registered but unconfirmed transactions for future processing.
114112
let mut unconfirmed_registered_txs = Vec::new();
115113

0 commit comments

Comments
 (0)