From 29c51d5086bb91c0d88cfb8495b4b851ad8eded7 Mon Sep 17 00:00:00 2001 From: Janito Vaqueiro Ferreira Filho Date: Mon, 31 May 2021 13:51:51 +0000 Subject: [PATCH] Implement `MetaAddr::set_last_seen` setter method Will be used when limiting the reported last seen times for recived gossiped addresses. --- zebra-network/src/meta_addr.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zebra-network/src/meta_addr.rs b/zebra-network/src/meta_addr.rs index 06fe2a0c7..9b323ee3e 100644 --- a/zebra-network/src/meta_addr.rs +++ b/zebra-network/src/meta_addr.rs @@ -238,6 +238,11 @@ impl MetaAddr { self.last_seen } + /// Set the last time we interacted with this peer. + pub(crate) fn set_last_seen(&mut self, last_seen: DateTime32) { + self.last_seen = last_seen; + } + /// Is this address a directly connected client? pub fn is_direct_client(&self) -> bool { match self.last_connection_state {