docs: additional response handling docs (#917)

This commit is contained in:
Matthias Seitz
2023-01-18 17:33:56 +01:00
committed by GitHub
parent 7db6791d9d
commit a1dfafe331
2 changed files with 5 additions and 2 deletions

View File

@@ -388,10 +388,9 @@ pub(crate) enum BlockResponseOutcome {
#[cfg(test)]
mod tests {
use super::*;
use crate::{peers::PeersManager, PeersConfig};
use reth_primitives::{H256, H512};
use super::*;
use std::future::poll_fn;
#[tokio::test(flavor = "multi_thread")]

View File

@@ -355,6 +355,10 @@ where
}
/// Invoked when received a response from a connected peer.
///
/// Delegates the response result to the fetcher which may return an outcome specific
/// instruction that needs to be handled in [Self::on_block_response_outcome]. This could be
/// a follow-up request or an instruction to slash the peer's reputation.
fn on_eth_response(&mut self, peer: PeerId, resp: PeerResponseResult) -> Option<StateAction> {
match resp {
PeerResponseResult::BlockHeaders(res) => {