Allow remotes to not open a legacy substream (#7075)

* Allow remotes to not open a legacy substream

* Misc fixes

* Special case first protocol as the one bearing the handshake
This commit is contained in:
Pierre Krieger
2020-09-14 17:08:23 +02:00
committed by GitHub
parent e18ddc6d4a
commit eadf5b09f9
8 changed files with 168 additions and 154 deletions
@@ -67,8 +67,6 @@ pub struct PeerInfo<Hash, Number> {
pub peer_id: String,
/// Roles
pub roles: String,
/// Protocol version
pub protocol_version: u32,
/// Peer best block hash
pub best_hash: Hash,
/// Peer best block number
@@ -110,11 +108,10 @@ mod tests {
::serde_json::to_string(&PeerInfo {
peer_id: "2".into(),
roles: "a".into(),
protocol_version: 2,
best_hash: 5u32,
best_number: 6u32,
}).unwrap(),
r#"{"peerId":"2","roles":"a","protocolVersion":2,"bestHash":5,"bestNumber":6}"#,
r#"{"peerId":"2","roles":"a","bestHash":5,"bestNumber":6}"#,
);
}
}