mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-29 09:08:05 -05:00
docs: additional response handling docs (#917)
This commit is contained in:
@@ -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")]
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user