From 5e170b8dd838e571f776902757a4a0dc1f36d6ca Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Tue, 4 Dec 2018 14:23:11 +0100 Subject: [PATCH] Make worker more resistant to weird data in ethereum blockchain --- api/worker.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/worker.go b/api/worker.go index 1e3c287c..b1036986 100644 --- a/api/worker.go +++ b/api/worker.go @@ -473,7 +473,11 @@ func (w *Worker) getEthereumTypeAddressBalances(addrDesc bchain.AddressDescripto } b, err = w.chain.EthereumTypeGetErc20ContractBalance(addrDesc, c.Contract) if err != nil { - return nil, nil, nil, errors.Annotatef(err, "EthereumTypeGetErc20ContractBalance %v %v", addrDesc, c.Contract) + // return nil, nil, nil, errors.Annotatef(err, "EthereumTypeGetErc20ContractBalance %v %v", addrDesc, c.Contract) + glog.Warningf("EthereumTypeGetErc20ContractBalance addr %v, contract %v, %v", addrDesc, c.Contract, err) + } + if b == nil { + b = &big.Int{} } erc20t[i] = Erc20Token{ Balance: bchain.AmountToDecimalString(b, ci.Decimals),