fix crash when calling MEV rpc with MEV disabled (#4389)

Avoid `/eth/v1/beacon/blinded_blocks` crash without `--payload-builder`.
This commit is contained in:
Etan Kissling 2022-12-05 20:41:52 +01:00 committed by GitHub
parent 55a95bca3c
commit 996a0bdcdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -48,6 +48,9 @@ proc unblindAndRouteBlockMEV*(
Future[Result[Opt[BlockRef], string]] {.async.} =
# By time submitBlindedBlock is called, must already have done slashing
# protection check
if node.payloadBuilderRestClient.isNil:
return err "unblindAndRouteBlockMEV: nil REST client"
let unblindedPayload =
try:
awaitWithTimeout(