]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/check.go
MTH memory usage optimization
[nncp.git] / src / check.go
index 7a3d5b8041a42a11059b763a5a2ac3e285c54646..d6a98fac805f3bcbff2b84af5da4ef804424d56c 100644 (file)
@@ -103,8 +103,10 @@ func (ctx *Ctx) CheckNoCK(nodeId *NodeId, hshValue *[MTHSize]byte, mth MTH) (int
        if mth == nil {
                gut, err = Check(fd, size, hshValue[:], les, ctx.ShowPrgrs)
        } else {
-               mth.SetPktName(pktName)
-               if _, err = mth.PrependFrom(bufio.NewReaderSize(fd, MTHSize)); err != nil {
+               if _, err = mth.PreaddFrom(
+                       bufio.NewReaderSize(fd, MTHSize),
+                       pktName, ctx.ShowPrgrs,
+               ); err != nil {
                        return 0, err
                }
                if bytes.Compare(mth.Sum(nil), hshValue[:]) == 0 {