From 6a0cc4e4fd48fd179bd8514dae2943e1c0c64f9e Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Sun, 18 Aug 2024 15:13:08 +0800 Subject: [PATCH] PeerStore: do not show error when AddrManager db not exist --- network/src/peer_store/peer_store_db.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/network/src/peer_store/peer_store_db.rs b/network/src/peer_store/peer_store_db.rs index a3e71d44ce..ca0f89b7dd 100644 --- a/network/src/peer_store/peer_store_db.rs +++ b/network/src/peer_store/peer_store_db.rs @@ -72,10 +72,17 @@ impl PeerStore { let addr_manager = File::open(&addr_manager_path) .map_err(|err| { - debug!( - "Failed to open AddrManager db, file: {:?}, error: {:?}", - addr_manager_path, err - ) + if err.kind() == std::io::ErrorKind::NotFound { + debug!( + "AddrManager db {:?} not found: {:?}", + addr_manager_path, err + ) + } else { + error!( + "Failed to open AddrManager db, file: {:?}, error: {:?}", + addr_manager_path, err + ) + } }) .and_then(|file| { AddrManager::load(std::io::BufReader::new(file)).map_err(|err| {