diff --git a/core/offchain.go b/core/offchain.go index 986fc2032..bc7535127 100644 --- a/core/offchain.go +++ b/core/offchain.go @@ -230,15 +230,19 @@ func (bc *BlockChain) CommitOffChainData( ) } } - if !doUpdate { - if err := rawdb.WriteValidatorStats(batch, paid[i].Addr, stats); err != nil { - utils.Logger().Info(). - Err(err).Msg("could not update earning per key in stats") + if doUpdate { + if err := rawdb.WriteValidatorStats( + batch, paid[i].Addr, stats, + ); err != nil { + utils.Logger().Info().Err(err). + Str("bls-earning-key", paid[i].EarningKey.Hex()). + Msg("could not update earning per key in stats") } } } else { - utils.Logger().Info(). - Err(err).Msg("could not read validator stats to update for earning per key") + utils.Logger().Info().Err(err). + Str("bls-earning-key", paid[i].EarningKey.Hex()). + Msg("could not read validator stats to update for earning per key") } } }