mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 02:07:56 +00:00
Add more debug_assert to networking (#8807)
* Add more debug_assertsudo dnf update to networking * Swap the lines
This commit is contained in:
@@ -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 })) => {
|
||||
|
||||
Reference in New Issue
Block a user