Zero the mempool metrics when the mempool is disabled (#2875)
Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
This commit is contained in:
parent
a21dd26a5e
commit
70ec51d770
|
|
@ -43,6 +43,13 @@ pub struct VerifiedSet {
|
||||||
orchard_nullifiers: HashSet<orchard::Nullifier>,
|
orchard_nullifiers: HashSet<orchard::Nullifier>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Drop for VerifiedSet {
|
||||||
|
fn drop(&mut self) {
|
||||||
|
// zero the metrics on drop
|
||||||
|
self.clear()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl VerifiedSet {
|
impl VerifiedSet {
|
||||||
/// Returns an iterator over the transactions in the set.
|
/// Returns an iterator over the transactions in the set.
|
||||||
pub fn transactions(&self) -> impl Iterator<Item = &UnminedTx> + '_ {
|
pub fn transactions(&self) -> impl Iterator<Item = &UnminedTx> + '_ {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue