From a5f8b8870a4397e125adb9a1f8d48537ed575ad5 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 11 Feb 2022 16:48:35 +0300 Subject: [PATCH] storage: use Update for changeset processing Batch is only relevant in multithreaded context, internally it'll do some magic and use the same locking/updating Update does, so it makes little sense for us. This doesn't change benchmarks in any noticeable way. --- pkg/core/storage/boltdb_store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/core/storage/boltdb_store.go b/pkg/core/storage/boltdb_store.go index 8f60aa5ee..59a1acbb1 100644 --- a/pkg/core/storage/boltdb_store.go +++ b/pkg/core/storage/boltdb_store.go @@ -92,7 +92,7 @@ func (s *BoltDBStore) PutBatch(batch Batch) error { func (s *BoltDBStore) PutChangeSet(puts map[string][]byte) error { var err error - return s.db.Batch(func(tx *bbolt.Tx) error { + return s.db.Update(func(tx *bbolt.Tx) error { b := tx.Bucket(Bucket) for k, v := range puts { if v != nil {