From ad3675eb3cd6c3185c90eed346f1fdc6f41d677a Mon Sep 17 00:00:00 2001 From: lunar-mining Date: Mon, 1 Jan 2024 15:41:21 +0100 Subject: [PATCH] store: fix death loop if we don't remove the greylist entry, keeps trying to connect to it --- src/net/hosts/store.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/net/hosts/store.rs b/src/net/hosts/store.rs index 20a506b56..7140f4e6e 100644 --- a/src/net/hosts/store.rs +++ b/src/net/hosts/store.rs @@ -454,6 +454,7 @@ impl Hosts { let (index, entry) = self.get_anchorlist_entry_at_addr(addr).await?; self.anchorlist_remove(addr, index).await; self.greylist_store_or_update(&[entry]).await?; + Ok(()) } else if self.whitelist_contains(addr).await { debug!(target: "net::store::downgrade_host()", @@ -461,11 +462,14 @@ impl Hosts { let (index, entry) = self.get_whitelist_entry_at_addr(addr).await?; self.whitelist_remove(addr, index).await; self.greylist_store_or_update(&[entry]).await?; + Ok(()) } else { debug!(target: "net::store::downgrade_host()", "Greylist entry detected! Do nothing for now..."); - // TODO + let index = self.get_greylist_index_at_addr(addr).await?; + self.greylist_remove(addr, index).await; + Ok(()) } }