Skip to content

Commit 42a3d6d

Browse files
majectyjunha1
authored andcommitted
Add hotfix comments
1 parent a20e149 commit 42a3d6d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

network/src/p2p/handler.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,8 @@ impl IoHandler<Message> for Handler {
516516
remote_node_id,
517517
token
518518
);
519+
// FIXME the if condition below is a hotfix.
520+
// `self.remote_node_ids_reverse.write().contains_key(&remote_node_id)` always should be false
519521
if !self.remote_node_ids_reverse.write().contains_key(&remote_node_id) {
520522
assert_eq!(
521523
None,
@@ -548,6 +550,8 @@ impl IoHandler<Message> for Handler {
548550
remote_node_id,
549551
token
550552
);
553+
// FIXME the if condition below is a hotfix.
554+
// `self.remote_node_ids_reverse.write().contains_key(&remote_node_id)` always should be false
551555
if !self.remote_node_ids_reverse.write().contains_key(&remote_node_id) {
552556
assert_eq!(
553557
None,

sync/src/block/extension.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,8 @@ impl NetworkExtension<Event> for Extension {
477477
cinfo!(SYNC, "New peer detected #{}", id);
478478
self.send_status(id);
479479

480+
// FIXME the if condition below is a hotfix.
481+
// `self.connected_nodes.contains(id)` always should be false
480482
if !self.connected_nodes.contains(id) {
481483
let t = self.connected_nodes.insert(*id);
482484
debug_assert!(t, "{} is already added to peer list", id);
@@ -488,6 +490,8 @@ impl NetworkExtension<Event> for Extension {
488490
request_id: None,
489491
};
490492

493+
// FIXME the if condition below is a hotfix.
494+
// `self.requests.contains(id)` always should be false
491495
if !self.requests.contains_key(id) {
492496
let t = self.requests.insert(*id, Vec::new());
493497
debug_assert_eq!(None, t);

0 commit comments

Comments
 (0)