]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/check.go
Raise copyright years
[nncp.git] / src / check.go
index 7a3d5b8041a42a11059b763a5a2ac3e285c54646..5872a1ffd8282cf8639c7ec786590ea4e1fc41af 100644 (file)
@@ -1,6 +1,6 @@
 /*
 NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2021 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2022 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -62,7 +62,7 @@ func (ctx *Ctx) checkXxIsBad(nodeId *NodeId, xx TRxTx) bool {
                        return true
                }
                gut, err := Check(fd, job.Size, job.HshValue[:], les, ctx.ShowPrgrs)
-               fd.Close() // #nosec G104
+               fd.Close()
                if err != nil {
                        ctx.LogE("checking", les, err, logMsg)
                        return true
@@ -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 {