mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-17 00:45:42 +00:00
The NodeId is always available in the session info (#859)
This commit is contained in:
@@ -21,9 +21,8 @@ use std::net::Ipv4Addr;
|
||||
use std::str;
|
||||
use std::time::Duration;
|
||||
use TimerToken;
|
||||
use libp2p::{multiaddr::Protocol, Multiaddr};
|
||||
use libp2p::{multiaddr::Protocol, Multiaddr, PeerId};
|
||||
use error::Error;
|
||||
use primitives::hash::H512;
|
||||
|
||||
/// Protocol handler level packet id
|
||||
pub type PacketId = u8;
|
||||
@@ -31,7 +30,7 @@ pub type PacketId = u8;
|
||||
pub type ProtocolId = [u8; 3];
|
||||
|
||||
/// Node public key
|
||||
pub type NodeId = H512;
|
||||
pub type NodeId = PeerId;
|
||||
|
||||
/// Local (temporary) peer session ID.
|
||||
pub type NodeIndex = usize;
|
||||
@@ -43,7 +42,7 @@ pub type Secret = [u8; 32];
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct SessionInfo {
|
||||
/// Peer public key
|
||||
pub id: Option<NodeId>,
|
||||
pub id: NodeId,
|
||||
/// Peer client ID
|
||||
pub client_version: String,
|
||||
/// Peer RLPx protocol version
|
||||
|
||||
Reference in New Issue
Block a user