Skip to content

Commit

Permalink
Add hotfix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
majecty authored and junha1 committed Dec 21, 2020
1 parent a20e149 commit 42a3d6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions network/src/p2p/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,8 @@ impl IoHandler<Message> 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,
Expand Down Expand Up @@ -548,6 +550,8 @@ impl IoHandler<Message> 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,
Expand Down
4 changes: 4 additions & 0 deletions sync/src/block/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,8 @@ impl NetworkExtension<Event> 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);
Expand All @@ -488,6 +490,8 @@ impl NetworkExtension<Event> 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);
Expand Down

0 comments on commit 42a3d6d

Please sign in to comment.