Skip to content

Commit

Permalink
revert debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaytonNorthey92 committed Jan 15, 2025
1 parent 8aabfa2 commit 9e22981
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions hemi/electrs/conn.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2024-2025 Hemi Labs, Inc.
// Copyright (c) 2024 Hemi Labs, Inc.
// Use of this source code is governed by the MIT License,
// which can be found in the LICENSE file.

Expand Down Expand Up @@ -155,8 +155,7 @@ func readResponse(ctx context.Context, r io.Reader, reqID uint64) (*JSONRPCRespo
return nil, ctx.Err()
default:
}

log.Debugf("Received a response from Electrs with ID 0, retrying read response... %s", res.Result)
log.Debugf("Received a response from Electrs with ID 0, retrying read response...")
return readResponse(ctx, r, reqID)
}
return nil, fmt.Errorf("response ID differs from request ID (%d != %d)", res.ID, reqID)
Expand Down
4 changes: 1 addition & 3 deletions hemi/electrs/electrs.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2024-2025 Hemi Labs, Inc.
// Copyright (c) 2024 Hemi Labs, Inc.
// Use of this source code is governed by the MIT License,
// which can be found in the LICENSE file.

Expand Down Expand Up @@ -263,13 +263,11 @@ func (c *Client) call(ctx context.Context, method string, params, result any) er
return retry.Do(ctx, backoff, func(ctx context.Context) error {
conn, err := c.connPool.acquireConn()
if err != nil {
log.Tracef("retryable error: %s", err)
return retry.RetryableError(fmt.Errorf("acquire connection: %w", err))
}

if err = conn.call(ctx, method, params, result); err != nil {
if errors.Is(err, net.ErrClosed) || errors.Is(err, syscall.EPIPE) {
log.Tracef("retryable error: %s", err)
return retry.RetryableError(err)
}
c.connPool.freeConn(conn)
Expand Down

0 comments on commit 9e22981

Please sign in to comment.