refactor: add Peers trait und decouple rpc from NetworkHandle (#1100)

This commit is contained in:
Matthias Seitz
2023-01-31 19:32:45 +01:00
committed by GitHub
parent 5da6b07d9e
commit 5c32ad01c9
16 changed files with 110 additions and 90 deletions

View File

@ -9,7 +9,7 @@ use crate::{
use futures::StreamExt;
use reth_eth_wire::{errors::EthStreamError, DisconnectReason};
use reth_net_common::ban_list::BanList;
use reth_network_api::ReputationChangeKind;
use reth_network_api::{PeerKind, ReputationChangeKind};
use reth_primitives::{ForkId, NodeRecord, PeerId};
use std::{
collections::{hash_map::Entry, HashMap, HashSet, VecDeque},
@ -860,16 +860,6 @@ impl PeerConnectionState {
}
}
/// Represents the kind of peer
#[derive(Debug, Clone, Copy, Default, Eq, PartialEq)]
pub enum PeerKind {
/// Basic peer kind.
#[default]
Basic,
/// Trusted peer.
Trusted,
}
/// Commands the [`PeersManager`] listens for.
pub(crate) enum PeerCommand {
/// Command for manually add