mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-15 09:04:39 +00:00
mitigate Eth1Monitor being nil in merge scenario (#3600)
This commit is contained in:
parent
09b2f4c237
commit
0d5bbbc405
@ -449,7 +449,7 @@ proc getPayload*(p: Eth1Monitor,
|
||||
payloadId: bellatrix.PayloadID): Future[engine_api.ExecutionPayloadV1] =
|
||||
# Eth1 monitor can recycle connections without (external) warning; at least,
|
||||
# don't crash.
|
||||
if p.dataProvider.isNil:
|
||||
if p.isNil or p.dataProvider.isNil:
|
||||
var epr: Future[engine_api.ExecutionPayloadV1]
|
||||
epr.complete(default(engine_api.ExecutionPayloadV1))
|
||||
return epr
|
||||
@ -472,7 +472,7 @@ proc forkchoiceUpdated*(p: Eth1Monitor,
|
||||
Future[engine_api.ForkchoiceUpdatedResponse] =
|
||||
# Eth1 monitor can recycle connections without (external) warning; at least,
|
||||
# don't crash.
|
||||
if p.dataProvider.isNil:
|
||||
if p.isNil or p.dataProvider.isNil:
|
||||
var fcuR: Future[engine_api.ForkchoiceUpdatedResponse]
|
||||
fcuR.complete(engine_api.ForkchoiceUpdatedResponse(
|
||||
payloadStatus: PayloadStatusV1(status: PayloadExecutionStatus.syncing)))
|
||||
@ -498,7 +498,7 @@ proc forkchoiceUpdated*(p: Eth1Monitor,
|
||||
Future[engine_api.ForkchoiceUpdatedResponse] =
|
||||
# Eth1 monitor can recycle connections without (external) warning; at least,
|
||||
# don't crash.
|
||||
if p.dataProvider.isNil:
|
||||
if p.isNil or p.dataProvider.isNil:
|
||||
var fcuR: Future[engine_api.ForkchoiceUpdatedResponse]
|
||||
fcuR.complete(engine_api.ForkchoiceUpdatedResponse(
|
||||
payloadStatus: PayloadStatusV1(status: PayloadExecutionStatus.syncing)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user