Skip to content
Snippets Groups Projects
Commit 3b1b339b authored by Pierre Krieger's avatar Pierre Krieger Committed by GitHub
Browse files

Add more debug_assert to networking (#8807)

* Add more debug_assertsudo dnf update to networking

* Swap the lines
parent 033d8289
No related merge requests found
......@@ -1549,7 +1549,9 @@ impl<B: BlockT + 'static, H: ExHashT> Future for NetworkWorker<B, H> {
}
{
let mut peers_notifications_sinks = this.peers_notifications_sinks.lock();
peers_notifications_sinks.insert((remote.clone(), protocol.clone()), notifications_sink);
let _previous_value = peers_notifications_sinks
.insert((remote.clone(), protocol.clone()), notifications_sink);
debug_assert!(_previous_value.is_none());
}
this.event_streams.send(Event::NotificationStreamOpened {
remote,
......@@ -1569,6 +1571,7 @@ impl<B: BlockT + 'static, H: ExHashT> Future for NetworkWorker<B, H> {
target: "sub-libp2p",
"NotificationStreamReplaced for non-existing substream"
);
debug_assert!(false);
}
// TODO: Notifications might have been lost as a result of the previous
......@@ -1603,7 +1606,9 @@ impl<B: BlockT + 'static, H: ExHashT> Future for NetworkWorker<B, H> {
});
{
let mut peers_notifications_sinks = this.peers_notifications_sinks.lock();
peers_notifications_sinks.remove(&(remote.clone(), protocol));
let _previous_value = peers_notifications_sinks
.remove(&(remote.clone(), protocol));
debug_assert!(_previous_value.is_some());
}
},
Poll::Ready(SwarmEvent::Behaviour(BehaviourOut::NotificationsReceived { remote, messages })) => {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment