Skip to content

Commit

Permalink
avoid redundant allocations
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaidashenko committed Aug 29, 2024
1 parent 17b795c commit 76343e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/txmgr/confirmer.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package txmgr

import (
"bytes"
"context"
"encoding/hex"
"errors"
Expand Down Expand Up @@ -1116,7 +1117,7 @@ func hasReceiptInLongestChain[
for {
for _, attempt := range etx.TxAttempts {
for _, receipt := range attempt.Receipts {
if receipt.GetBlockHash().String() == head.BlockHash().String() && receipt.GetBlockNumber().Int64() == head.BlockNumber() {
if bytes.Equal(receipt.GetBlockHash().Bytes(), head.BlockHash().Bytes()) && receipt.GetBlockNumber().Int64() == head.BlockNumber() {
return true
}
}
Expand Down

0 comments on commit 76343e5

Please sign in to comment.