mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-19 15:45:41 +00:00
Randomly fuzz the PSM (#2470)
* Randomly fuzz the PSM * Fix test * Run it moar
This commit is contained in:
committed by
Gavin Wood
parent
0d0fe6a0ea
commit
0181833f89
@@ -90,7 +90,7 @@ pub enum Message {
|
||||
}
|
||||
|
||||
/// Opaque identifier for an incoming connection. Allocated by the network.
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct IncomingIndex(pub u64);
|
||||
|
||||
impl From<u64> for IncomingIndex {
|
||||
@@ -316,8 +316,9 @@ impl Peerset {
|
||||
/// connection implicitely means `Connect`, but incoming connections aren't cancelled by
|
||||
/// `dropped`.
|
||||
///
|
||||
/// Because of concurrency issues, it is acceptable to call `incoming` with a `PeerId` the
|
||||
/// peerset is already connected to, in which case it must not answer.
|
||||
// Implementation note: because of concurrency issues, it is possible that we push a `Connect`
|
||||
// message to the output channel with a `PeerId`, and that `incoming` gets called with the same
|
||||
// `PeerId` before that message has been read by the user. In this situation we must not answer.
|
||||
pub fn incoming(&mut self, peer_id: PeerId, index: IncomingIndex) {
|
||||
trace!(target: "peerset", "Incoming {:?}", peer_id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user