Skip to content

Commit 0daed49

Browse files
tomakadarkfriend77
authored andcommitted
Fix wrong value put for pending_opening (paritytech#7633)
* Fix wrong value put for pending_opening * Oops, didn't even try compiling it
1 parent d348970 commit 0daed49

File tree

1 file changed

+3
-1
lines changed
  • client/network/src/protocol/generic_proto

1 file changed

+3
-1
lines changed

client/network/src/protocol/generic_proto/handler.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ impl ProtocolsHandler for NotifsHandler {
684684
_ => unreachable!()
685685
};
686686

687+
debug_assert_eq!(pending_opening.len(), self.out_protocols.len());
687688
for (n, is_pending) in pending_opening.iter().enumerate() {
688689
if *is_pending {
689690
continue;
@@ -740,8 +741,9 @@ impl ProtocolsHandler for NotifsHandler {
740741

741742
match &mut self.state {
742743
State::Open { .. } => {
744+
let pending_opening = self.out_protocols.iter().map(|_| false).collect();
743745
self.state = State::Closed {
744-
pending_opening: Vec::new(),
746+
pending_opening,
745747
};
746748
},
747749
State::Opening { out_substreams, .. } => {

0 commit comments

Comments
 (0)