From 4f29180e7ca82b5e67d5d5858a1168d2066a2173 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Sat, 22 Feb 2020 16:51:23 +0100 Subject: [PATCH 1/2] lib/db: Don't panic on incorrect BlocksHash (fixes #6353) (#6355) --- lib/db/transactions.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/db/transactions.go b/lib/db/transactions.go index 9ecef99af..003c17ce8 100644 --- a/lib/db/transactions.go +++ b/lib/db/transactions.go @@ -469,8 +469,8 @@ func (t readWriteTransaction) putFile(key []byte, fi protocol.FileInfo) error { return err } } else if fi.BlocksHash != nil { - l.Warnln("Blocks is nil, but BlocksHash is not for file", fi) - panic("Blocks is nil, but BlocksHash is not") + l.Debugln("Blocks is nil, but BlocksHash is not for file", fi) + fi.BlocksHash = nil } fi.Blocks = nil From a5e12a0a3dc2fc9be069cb3f302ed2a67c6a3f25 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sat, 22 Feb 2020 17:44:20 +0100 Subject: [PATCH 2/2] lib/db: Allow put partial FileInfo without blocks (ref #6353) --- lib/db/transactions.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/db/transactions.go b/lib/db/transactions.go index 003c17ce8..e18f872a7 100644 --- a/lib/db/transactions.go +++ b/lib/db/transactions.go @@ -468,9 +468,6 @@ func (t readWriteTransaction) putFile(key []byte, fi protocol.FileInfo) error { } else if err != nil { return err } - } else if fi.BlocksHash != nil { - l.Debugln("Blocks is nil, but BlocksHash is not for file", fi) - fi.BlocksHash = nil } fi.Blocks = nil