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