mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
log upgrades + prevent dialing of disconnecting peers (#3148)
## Issue Addressed We still ping peers that are considered in a disconnecting state ## Proposed Changes Do not ping peers once we decide they are disconnecting Upgrade logs about ignored rpc messages ## Additional Info --
This commit is contained in:
@@ -335,6 +335,19 @@ impl RPCResponseErrorCode {
|
||||
}
|
||||
}
|
||||
|
||||
use super::Protocol;
|
||||
impl<T: EthSpec> RPCResponse<T> {
|
||||
pub fn protocol(&self) -> Protocol {
|
||||
match self {
|
||||
RPCResponse::Status(_) => Protocol::Status,
|
||||
RPCResponse::BlocksByRange(_) => Protocol::BlocksByRange,
|
||||
RPCResponse::BlocksByRoot(_) => Protocol::BlocksByRoot,
|
||||
RPCResponse::Pong(_) => Protocol::Ping,
|
||||
RPCResponse::MetaData(_) => Protocol::MetaData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for RPCResponseErrorCode {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
let repr = match self {
|
||||
|
||||
Reference in New Issue
Block a user