]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/check.go
Use bytes.Equal() instead of bytes.Compare()==0
[nncp.git] / src / check.go
index 6a1b18ab846b19fe87cb5ec588fbf5aa96089b62..a4e0d06d31ea7cc51048acb4ec8b0d7a5a0dbd9f 100644 (file)
@@ -44,7 +44,7 @@ func Check(
        ); err != nil {
                return false, err
        }
-       return bytes.Compare(hsh.Sum(nil), checksum) == 0, nil
+       return bytes.Equal(hsh.Sum(nil), checksum), nil
 }
 
 func (ctx *Ctx) checkXxIsBad(nodeId *NodeId, xx TRxTx) bool {
@@ -113,7 +113,7 @@ func (ctx *Ctx) CheckNoCK(nodeId *NodeId, hshValue *[MTHSize]byte, mth MTH) (int
                ); err != nil {
                        return 0, err
                }
-               if bytes.Compare(mth.Sum(nil), hshValue[:]) == 0 {
+               if bytes.Equal(mth.Sum(nil), hshValue[:]) {
                        gut = true
                }
        }