]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Don't log missing files during hashing
authorMatt Joiner <anacrolix@gmail.com>
Mon, 16 May 2016 09:50:46 +0000 (19:50 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 16 May 2016 09:50:46 +0000 (19:50 +1000)
torrent.go

index 7d027fae1037323df14134eee4a08634316e9135..296db4be4e2376ba9ad86d26e8204de219e6e338 100644 (file)
@@ -9,6 +9,7 @@ import (
        "math"
        "math/rand"
        "net"
+       "os"
        "sort"
        "sync"
        "time"
@@ -626,7 +627,7 @@ func (t *Torrent) hashPiece(piece int) (ret metainfo.Hash) {
                missinggo.CopyExact(&ret, hash.Sum(nil))
                return
        }
-       if err != io.ErrUnexpectedEOF {
+       if err != io.ErrUnexpectedEOF && !os.IsNotExist(err) {
                log.Printf("unexpected error hashing piece with %T: %s", t.storage, err)
        }
        return