Skip to content

Commit 287b146

Browse files
committed
feat(core): Add TxUpdate::missing
This is a set of txids missing from the mempool.
1 parent 80d62e4 commit 287b146

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/core/src/tx_update.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::collections::{BTreeMap, BTreeSet, HashMap};
1+
use crate::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
22
use alloc::{sync::Arc, vec::Vec};
33
use bitcoin::{OutPoint, Transaction, TxOut, Txid};
44

@@ -34,6 +34,8 @@ pub struct TxUpdate<A = ()> {
3434
/// Seen at times for transactions. This records when a transaction was most recently seen in
3535
/// the user's mempool for the sake of tie-breaking other conflicting transactions.
3636
pub seen_ats: HashMap<Txid, u64>,
37+
/// A set of txids missing from the mempool.
38+
pub missing: HashSet<Txid>,
3739
}
3840

3941
impl<A> Default for TxUpdate<A> {
@@ -43,6 +45,7 @@ impl<A> Default for TxUpdate<A> {
4345
txouts: Default::default(),
4446
anchors: Default::default(),
4547
seen_ats: Default::default(),
48+
missing: Default::default(),
4649
}
4750
}
4851
}
@@ -62,6 +65,7 @@ impl<A: Ord> TxUpdate<A> {
6265
.map(|(a, txid)| (map(a), txid))
6366
.collect(),
6467
seen_ats: self.seen_ats,
68+
missing: self.missing,
6569
}
6670
}
6771

0 commit comments

Comments
 (0)