From 42a3d6d9dd8423404d8484c32c058c254185762d Mon Sep 17 00:00:00 2001 From: Park Juhyung Date: Mon, 21 Dec 2020 13:34:37 +0900 Subject: [PATCH] Add hotfix comments --- network/src/p2p/handler.rs | 4 ++++ sync/src/block/extension.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/network/src/p2p/handler.rs b/network/src/p2p/handler.rs index 2168c010d4..a25e8a0d09 100644 --- a/network/src/p2p/handler.rs +++ b/network/src/p2p/handler.rs @@ -516,6 +516,8 @@ impl IoHandler for Handler { remote_node_id, token ); + // FIXME the if condition below is a hotfix. + // `self.remote_node_ids_reverse.write().contains_key(&remote_node_id)` always should be false if !self.remote_node_ids_reverse.write().contains_key(&remote_node_id) { assert_eq!( None, @@ -548,6 +550,8 @@ impl IoHandler for Handler { remote_node_id, token ); + // FIXME the if condition below is a hotfix. + // `self.remote_node_ids_reverse.write().contains_key(&remote_node_id)` always should be false if !self.remote_node_ids_reverse.write().contains_key(&remote_node_id) { assert_eq!( None, diff --git a/sync/src/block/extension.rs b/sync/src/block/extension.rs index 5ae82e2ac7..5090ac4218 100644 --- a/sync/src/block/extension.rs +++ b/sync/src/block/extension.rs @@ -477,6 +477,8 @@ impl NetworkExtension for Extension { cinfo!(SYNC, "New peer detected #{}", id); self.send_status(id); + // FIXME the if condition below is a hotfix. + // `self.connected_nodes.contains(id)` always should be false if !self.connected_nodes.contains(id) { let t = self.connected_nodes.insert(*id); debug_assert!(t, "{} is already added to peer list", id); @@ -488,6 +490,8 @@ impl NetworkExtension for Extension { request_id: None, }; + // FIXME the if condition below is a hotfix. + // `self.requests.contains(id)` always should be false if !self.requests.contains_key(id) { let t = self.requests.insert(*id, Vec::new()); debug_assert_eq!(None, t);