diff --git a/zebrad/src/components/mempool/storage/verified_set.rs b/zebrad/src/components/mempool/storage/verified_set.rs index 87d94aafbeb..7a120c096e5 100644 --- a/zebrad/src/components/mempool/storage/verified_set.rs +++ b/zebrad/src/components/mempool/storage/verified_set.rs @@ -43,6 +43,13 @@ pub struct VerifiedSet { orchard_nullifiers: HashSet, } +impl Drop for VerifiedSet { + fn drop(&mut self) { + // zero the metrics on drop + self.clear() + } +} + impl VerifiedSet { /// Returns an iterator over the transactions in the set. pub fn transactions(&self) -> impl Iterator + '_ {