Skip to content

Commit ae0336b

Browse files
committed
feat(core): Add TxUpdate::evicted_ats
This is a set of evicted txs from the mempool.
1 parent 9af0fd4 commit ae0336b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

crates/core/src/tx_update.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ pub struct TxUpdate<A = ()> {
4444
/// [`SyncRequest::start_time`](crate::spk_client::SyncRequest::start_time) can be used to
4545
/// provide the `seen_at` value.
4646
pub seen_ats: HashSet<(Txid, u64)>,
47+
48+
/// When transactions were discovered to be missing (evicted) from the mempool.
49+
///
50+
/// [`SyncRequest::start_time`](crate::spk_client::SyncRequest::start_time) can be used to
51+
/// provide the `evicted_at` value.
52+
pub evicted_ats: HashSet<(Txid, u64)>,
4753
}
4854

4955
impl<A> Default for TxUpdate<A> {
@@ -53,6 +59,7 @@ impl<A> Default for TxUpdate<A> {
5359
txouts: Default::default(),
5460
anchors: Default::default(),
5561
seen_ats: Default::default(),
62+
evicted_ats: Default::default(),
5663
}
5764
}
5865
}
@@ -72,6 +79,7 @@ impl<A: Ord> TxUpdate<A> {
7279
.map(|(a, txid)| (map(a), txid))
7380
.collect(),
7481
seen_ats: self.seen_ats,
82+
evicted_ats: self.evicted_ats,
7583
}
7684
}
7785

@@ -81,5 +89,6 @@ impl<A: Ord> TxUpdate<A> {
8189
self.txouts.extend(other.txouts);
8290
self.anchors.extend(other.anchors);
8391
self.seen_ats.extend(other.seen_ats);
92+
self.evicted_ats.extend(other.evicted_ats);
8493
}
8594
}

0 commit comments

Comments
 (0)