From bc8e3c02eefce5ea80641d13d488d0d26351584a Mon Sep 17 00:00:00 2001 From: Jordan Hrycaj Date: Mon, 20 May 2024 15:02:36 +0000 Subject: [PATCH] Fix missing disabling of `eth` service (#2199) why: Otherwise it might crash on a not fully initialised call back function when most other functions are disabled during the early sync state. --- nimbus/sync/handlers/eth.nim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nimbus/sync/handlers/eth.nim b/nimbus/sync/handlers/eth.nim index bbc83de21..2101c57eb 100644 --- a/nimbus/sync/handlers/eth.nim +++ b/nimbus/sync/handlers/eth.nim @@ -610,6 +610,10 @@ method handleNewBlock*(ctx: EthWireRef, totalDifficulty: DifficultyInt): Result[void, string] {.gcsafe.} = + if ctx.enableTxPool != Enabled: + when trMissingOrDisabledGossipOk: + notEnabled("handleNewBlock") + return ok() try: if ctx.chain.com.forkGTE(MergeFork): debug "Dropping peer for sending NewBlock after merge (EIP-3675)", @@ -632,6 +636,10 @@ method handleNewBlockHashes*(ctx: EthWireRef, hashes: openArray[NewBlockHashesAnnounce]): Result[void, string] {.gcsafe.} = + if ctx.enableTxPool != Enabled: + when trMissingOrDisabledGossipOk: + notEnabled("handleNewBlockHashes") + return ok() try: if ctx.chain.com.forkGTE(MergeFork): debug "Dropping peer for sending NewBlockHashes after merge (EIP-3675)",