From ae0336b205f3b29253b5be3142dff54a4da09232 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BF=97=E5=AE=87?= Date: Fri, 24 Jan 2025 17:51:51 +1100 Subject: [PATCH] feat(core): Add `TxUpdate::evicted_ats` This is a set of evicted txs from the mempool. --- crates/core/src/tx_update.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/core/src/tx_update.rs b/crates/core/src/tx_update.rs index 0b548313..89a224fb 100644 --- a/crates/core/src/tx_update.rs +++ b/crates/core/src/tx_update.rs @@ -44,6 +44,12 @@ pub struct TxUpdate { /// [`SyncRequest::start_time`](crate::spk_client::SyncRequest::start_time) can be used to /// provide the `seen_at` value. pub seen_ats: HashSet<(Txid, u64)>, + + /// When transactions were discovered to be missing (evicted) from the mempool. + /// + /// [`SyncRequest::start_time`](crate::spk_client::SyncRequest::start_time) can be used to + /// provide the `evicted_at` value. + pub evicted_ats: HashSet<(Txid, u64)>, } impl Default for TxUpdate { @@ -53,6 +59,7 @@ impl Default for TxUpdate { txouts: Default::default(), anchors: Default::default(), seen_ats: Default::default(), + evicted_ats: Default::default(), } } } @@ -72,6 +79,7 @@ impl TxUpdate { .map(|(a, txid)| (map(a), txid)) .collect(), seen_ats: self.seen_ats, + evicted_ats: self.evicted_ats, } } @@ -81,5 +89,6 @@ impl TxUpdate { self.txouts.extend(other.txouts); self.anchors.extend(other.anchors); self.seen_ats.extend(other.seen_ats); + self.evicted_ats.extend(other.evicted_ats); } } -- 2.49.0