From 215bb10a29dd46b1a0b81e58c48318fd92b49096 Mon Sep 17 00:00:00 2001 From: Diego Nava Date: Wed, 27 Sep 2023 16:09:34 +0200 Subject: [PATCH] minnor fixes --- cmd/harmony/main.go | 8 +++++--- core/preimages.go | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd/harmony/main.go b/cmd/harmony/main.go index 5df0c41cc..a820abf14 100644 --- a/cmd/harmony/main.go +++ b/cmd/harmony/main.go @@ -504,9 +504,11 @@ func setupNodeAndRun(hc harmonyconfig.HarmonyConfig) { Msg("Start Rosetta failed") } - go func() { - core.WritePreimagesMetricsIntoPrometheus(currentNode.Blockchain(), currentNode.Consensus.UpdatePreimageGenerationMetrics) - }() + go core.WritePreimagesMetricsIntoPrometheus( + currentNode.Blockchain(), + currentNode.Consensus.UpdatePreimageGenerationMetrics, + ) + go listenOSSigAndShutDown(currentNode) if !hc.General.IsOffline { diff --git a/core/preimages.go b/core/preimages.go index 70f69b349..8605271a7 100644 --- a/core/preimages.go +++ b/core/preimages.go @@ -328,11 +328,13 @@ func VerifyPreimages(header *block.Header, chain BlockChain) (uint64, error) { key := accountIterator.LeafKey() preimage := rawdb.ReadPreimage(diskDB, common.BytesToHash(key)) if len(preimage) == 0 { - return 0, errors.New( + err := errors.New( fmt.Sprintf( "cannot find preimage for %x after '%d' accounts", key, existingPreimages, ), ) + utils.Logger().Warn().Msg(err.Error()) + return existingPreimages, err } address := common.BytesToAddress(preimage) // skip blank address