Skip to content

Commit

Permalink
Minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed May 29, 2024
1 parent 060a2e9 commit d7f0a3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wormhole/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (c *Client) SendText(ctx context.Context, msg string, opts ...SendOption) (
close(ch)
return
} else {
sendErr(fmt.Errorf("unexpected answer"))
sendErr(errors.New("unexpected answer"))
return
}
}()
Expand Down Expand Up @@ -423,7 +423,7 @@ func (c *Client) sendFileDirectory(ctx context.Context, offer *offerMsg, r io.Re
}

shaSum := hex.EncodeToString(hasher.Sum(nil))
if strings.ToLower(ack.SHA256) != shaSum {
if strings.EqualFold(ack.SHA256, shaSum) {
sendErr(fmt.Errorf("receiver sha256 mismatch %s vs %s", ack.SHA256, shaSum))
return
}
Expand Down

0 comments on commit d7f0a3f

Please sign in to comment.