diff --git a/lib/protocol/protocol.go b/lib/protocol/protocol.go index 3aac3ccd3..585fb7a0e 100644 --- a/lib/protocol/protocol.go +++ b/lib/protocol/protocol.go @@ -54,7 +54,7 @@ func init() { func BlockSize(fileSize int64) int { var blockSize int for _, blockSize = range BlockSizes { - if fileSize < int64(DesiredPerFileBlocks*blockSize) { + if fileSize < DesiredPerFileBlocks*int64(blockSize) { break } } diff --git a/lib/protocol/protocol_test.go b/lib/protocol/protocol_test.go index 8d193a28e..4c0a758bb 100644 --- a/lib/protocol/protocol_test.go +++ b/lib/protocol/protocol_test.go @@ -4,6 +4,7 @@ package protocol import ( "bytes" + "encoding/hex" "encoding/json" "errors" "io" @@ -12,8 +13,6 @@ import ( "testing" "testing/quick" - "encoding/hex" - "github.com/syncthing/syncthing/lib/rand" )