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

Add some debug_asserts for #8171 (#8181)

parent e9f12cb2
Branches
No related merge requests found
...@@ -319,14 +319,16 @@ impl<B: BlockT + 'static, H: ExHashT> TransactionsHandler<B, H> { ...@@ -319,14 +319,16 @@ impl<B: BlockT + 'static, H: ExHashT> TransactionsHandler<B, H> {
}, },
Event::NotificationStreamOpened { remote, protocol, role } if protocol == self.protocol_name => { Event::NotificationStreamOpened { remote, protocol, role } if protocol == self.protocol_name => {
self.peers.insert(remote, Peer { let _was_in = self.peers.insert(remote, Peer {
known_transactions: LruHashSet::new(NonZeroUsize::new(MAX_KNOWN_TRANSACTIONS) known_transactions: LruHashSet::new(NonZeroUsize::new(MAX_KNOWN_TRANSACTIONS)
.expect("Constant is nonzero")), .expect("Constant is nonzero")),
role, role,
}); });
debug_assert!(_was_in.is_none());
} }
Event::NotificationStreamClosed { remote, protocol } if protocol == self.protocol_name => { Event::NotificationStreamClosed { remote, protocol } if protocol == self.protocol_name => {
self.peers.remove(&remote); let _peer = self.peers.remove(&remote);
debug_assert!(_peer.is_some());
} }
Event::NotificationsReceived { remote, messages } => { Event::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