mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-01 03:07:23 +00:00
Add connected peers to protocol, use in sync provider (#1857)
* add connected peers to protocol, use in sync provider * use PeerId::random * address comments` * docs * fix import of PeerId * rewrite rpc tests using PeerId::random * whitespace * nits * remove option around peer id and remove field * further removal of the option around peer id * fix rpc tests
This commit is contained in:
committed by
Gav Wood
parent
ea7da0d4a4
commit
bc15fa31ff
@@ -111,9 +111,9 @@ impl<B: traits::Block> SystemApi<B::Hash, <B::Header as HeaderT>::Number> for Sy
|
||||
}
|
||||
|
||||
fn system_peers(&self) -> Result<Vec<PeerInfo<B::Hash, <B::Header as HeaderT>::Number>>> {
|
||||
Ok(self.sync.peers().into_iter().map(|(idx, peer_id, p)| PeerInfo {
|
||||
index: idx,
|
||||
peer_id: peer_id.map_or_else(Default::default, |p| p.to_base58()),
|
||||
Ok(self.sync.peers().into_iter().map(|(index, p)| PeerInfo {
|
||||
index,
|
||||
peer_id: p.peer_id.to_base58(),
|
||||
roles: format!("{:?}", p.roles),
|
||||
protocol_version: p.protocol_version,
|
||||
best_hash: p.best_hash,
|
||||
|
||||
Reference in New Issue
Block a user