Commit 12a59c45 authored by inphi's avatar inphi

logging

parent d004d450
...@@ -40,11 +40,11 @@ func (h *LatestBlockHead) Start() error { ...@@ -40,11 +40,11 @@ func (h *LatestBlockHead) Start() error {
for { for {
select { select {
case <-ticker.C: case <-ticker.C:
log.Trace("polling block head")
blockNum, err := h.getBlockNum() blockNum, err := h.getBlockNum()
if err != nil { if err != nil {
log.Error("failed to retrieve block head", "error", err) log.Error("error retrieving latest block number", "error", err)
} }
log.Trace("polling block number", "blockNum", blockNum)
h.mutex.Lock() h.mutex.Lock()
h.blockNum = blockNum h.blockNum = blockNum
h.mutex.Unlock() h.mutex.Unlock()
...@@ -78,7 +78,9 @@ func (h *LatestBlockHead) getBlockNum() (uint64, error) { ...@@ -78,7 +78,9 @@ func (h *LatestBlockHead) getBlockNum() (uint64, error) {
httpRes, httpErr := h.client.Do(httpReq) httpRes, httpErr := h.client.Do(httpReq)
if httpErr != nil { if httpErr != nil {
time.Sleep(calcBackoff(i)) backoff := calcBackoff(i)
log.Warn("http operation failed. retrying...", "error", err, "backoff", backoff)
time.Sleep(backoff)
continue continue
} }
if httpRes.StatusCode != 200 { if httpRes.StatusCode != 200 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment