Skip to content

Commit fc0e5e6

Browse files
author
Mikhail Zabaluev
committed
Header chain validation errors are not fatal
Do not exit the blockchain task if request validation fails. Logging the problem is enough.
1 parent 40f804a commit fc0e5e6

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

jormungandr/src/blockchain/process.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,18 @@ pub fn run_handle_input(
230230
}
231231
BlockMsg::ChainHeaders(handle) => {
232232
let (stream, reply) = handle.into_stream_and_reply();
233-
let future = candidate_forest.advance_branch(stream);
233+
let logger = info.logger().clone();
234234

235-
let future = future.then(|resp| match resp {
235+
let future = candidate_forest.advance_branch(stream);
236+
let future = future.then(move |resp| match resp {
236237
Err(e) => {
238+
info!(
239+
logger,
240+
"error processing an incoming header stream";
241+
"reason" => %e,
242+
);
237243
reply.reply_error(chain_header_error_into_reply(e));
238-
Either::A(future::err::<(), Error>(
239-
format!("Error processing ChainHeader handling").into(),
240-
))
244+
Either::A(future::ok(()))
241245
}
242246
Ok((hashes, maybe_remainder)) => {
243247
if hashes.is_empty() {

0 commit comments

Comments
 (0)