diff --git a/api/worker.go b/api/worker.go index b2a47795..b20a7d6c 100644 --- a/api/worker.go +++ b/api/worker.go @@ -1097,6 +1097,7 @@ func (w *Worker) GetSystemInfo(internal bool) (*SystemInfo, error) { ci, err := w.chain.GetChainInfo() var backendError string if err != nil { + glog.Error("GetChainInfo error ", err) backendError = errors.Annotatef(err, "GetChainInfo").Error() ci = &bchain.ChainInfo{} // set not in sync in case of backend error diff --git a/bchain/coins/eth/ethrpc.go b/bchain/coins/eth/ethrpc.go index 3103bf43..4142a25d 100644 --- a/bchain/coins/eth/ethrpc.go +++ b/bchain/coins/eth/ethrpc.go @@ -327,13 +327,13 @@ func (b *EthereumRPC) GetSubversion() string { // GetChainInfo returns information about the connected backend func (b *EthereumRPC) GetChainInfo() (*bchain.ChainInfo, error) { - ctx, cancel := context.WithTimeout(context.Background(), b.timeout) - defer cancel() - id, err := b.client.NetworkID(ctx) + h, err := b.getBestHeader() if err != nil { return nil, err } - h, err := b.getBestHeader() + ctx, cancel := context.WithTimeout(context.Background(), b.timeout) + defer cancel() + id, err := b.client.NetworkID(ctx) if err != nil { return nil, err }