mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 16:51:03 +00:00
Fix two potential connection poisonings (#7677)
This commit is contained in:
@@ -1565,6 +1565,7 @@ impl NetworkBehaviour for GenericProto {
|
|||||||
connec_state,
|
connec_state,
|
||||||
ConnectionState::OpeningThenClosing
|
ConnectionState::OpeningThenClosing
|
||||||
));
|
));
|
||||||
|
*entry.into_mut() = PeerState::Disabled { connections, backoff_until };
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
error!(
|
error!(
|
||||||
@@ -1652,6 +1653,7 @@ impl NetworkBehaviour for GenericProto {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if matches!(connections[pos].1, ConnectionState::Closing) {
|
if matches!(connections[pos].1, ConnectionState::Closing) {
|
||||||
|
*entry.into_mut() = PeerState::Enabled { connections };
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1683,7 +1685,7 @@ impl NetworkBehaviour for GenericProto {
|
|||||||
notifications_sink: replacement_sink,
|
notifications_sink: replacement_sink,
|
||||||
};
|
};
|
||||||
self.events.push_back(NetworkBehaviourAction::GenerateEvent(event));
|
self.events.push_back(NetworkBehaviourAction::GenerateEvent(event));
|
||||||
*entry.into_mut() = PeerState::Enabled { connections, };
|
*entry.into_mut() = PeerState::Enabled { connections };
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user