Node: better error reporting in peer validator
This commit is contained in:
parent
054506a85f
commit
9d30a8f4bf
@ -191,12 +191,13 @@ let rec worker_loop pv =
|
||||
end >>= function
|
||||
| Ok () ->
|
||||
worker_loop pv
|
||||
| Error (( Unknown_ancestor
|
||||
| Error ((( Unknown_ancestor
|
||||
| Block_locator.Invalid_locator _
|
||||
| Block_validator.Invalid_block _ ) :: _) ->
|
||||
| Block_validator.Invalid_block _ ) :: _) as errors ) ->
|
||||
(* TODO ban the peer_id... *)
|
||||
lwt_log_info "Terminating the validation worker for peer %a (kickban)."
|
||||
P2p.Peer_id.pp_short pv.peer_id >>= fun () ->
|
||||
lwt_debug "%a" Error_monad.pp_print_error errors >>= fun () ->
|
||||
Lwt_canceler.cancel pv.canceler >>= fun () ->
|
||||
Lwt.return_unit
|
||||
| Error [Block_validator.Unavailable_protocol { protocol } ] -> begin
|
||||
|
Loading…
Reference in New Issue
Block a user