File tree Expand file tree Collapse file tree 4 files changed +7
-6
lines changed
Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -722,7 +722,7 @@ func (c *Client) handleRollForward(msgGeneric protocol.Message) error {
722722 }
723723 }
724724 if callbackErr != nil {
725- if callbackErr == StopSyncProcessError {
725+ if errors . Is ( callbackErr , StopSyncProcessError ) {
726726 // Signal that we're cancelling the sync
727727 c .readyForNextBlockChan <- false
728728 return nil
@@ -751,7 +751,7 @@ func (c *Client) handleRollBackward(msg protocol.Message) error {
751751 }
752752 // Call the user callback function
753753 if callbackErr := c .config .RollBackwardFunc (c .callbackContext , msgRollBackward .Point , msgRollBackward .Tip ); callbackErr != nil {
754- if callbackErr == StopSyncProcessError {
754+ if errors . Is ( callbackErr , StopSyncProcessError ) {
755755 // Signal that we're cancelling the sync
756756 c .readyForNextBlockChan <- false
757757 return nil
Original file line number Diff line number Diff line change 1- // Copyright 2024 Blink Labs Software
1+ // Copyright 2025 Blink Labs Software
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
1515package chainsync_test
1616
1717import (
18+ "errors"
1819 "fmt"
1920 "reflect"
2021 "testing"
@@ -127,7 +128,7 @@ func TestIntersectNotFound(t *testing.T) {
127128 if err == nil {
128129 t .Fatalf ("did not receive expected error" )
129130 }
130- if err != chainsync .IntersectNotFoundError {
131+ if ! errors . Is ( err , chainsync .IntersectNotFoundError ) {
131132 t .Fatalf (
132133 "did not receive expected error\n got: %s\n wanted: %s" ,
133134 err ,
Original file line number Diff line number Diff line change @@ -203,7 +203,7 @@ func (s *Server) handleFindIntersect(msg protocol.Message) error {
203203 msgFindIntersect .Points ,
204204 )
205205 if err != nil {
206- if err == IntersectNotFoundError {
206+ if errors . Is ( err , IntersectNotFoundError ) {
207207 msgResp := NewMsgIntersectNotFound (tip )
208208 if err := s .SendMessage (msgResp ); err != nil {
209209 return err
Original file line number Diff line number Diff line change @@ -363,7 +363,7 @@ func (p *Protocol) recvLoop() {
363363 tmpMsg := []cbor.RawMessage {}
364364 numBytesRead , err := cbor .Decode (recvBuffer .Bytes (), & tmpMsg )
365365 if err != nil {
366- if err == io .ErrUnexpectedEOF && recvBuffer .Len () > 0 {
366+ if errors . Is ( err , io .ErrUnexpectedEOF ) && recvBuffer .Len () > 0 {
367367 // This is probably a multi-part message, so we wait until we get more of the message
368368 // before trying to process it
369369 p .recvReadyChan <- true
You can’t perform that action at this time.
0 commit comments