arnaucube
arnaucube/hermez-nodePublic Self-hosted repository
Merge pull request #676 from hermeznetwork/feature/warnLogPriceUpdate

added checker and log.warn to updateMethodTypeStatic
Danilo Pantani danpantani@gmail.com
Wed, 31 Mar 2021 12:40:01 -0300
commit

2dba819696e7d574a684cc02562a6844f8aeb391

parent

629c67a62e60cc912d4a15eced5271d956906893

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M priceupdater/priceupdater.go → priceupdater/priceupdater.go

@@ -173,6 +173,10 @@ case UpdateMethodTypeCoingeckoV3:

tokenPrice, err = p.getTokenPriceCoingecko(ctx, token.Addr) case UpdateMethodTypeStatic: tokenPrice = token.StaticValue + if tokenPrice == float64(0) { + log.Warn("token price is set to 0. Probably StaticValue is not put in the configuration file,", + "token", token.Symbol) + } case UpdateMethodTypeIgnore: continue }