From 4071488ef25aadd6091a02b972c0c61c96b37dc0 Mon Sep 17 00:00:00 2001 From: vyzo Date: Fri, 2 Jul 2021 14:25:02 +0300 Subject: [PATCH] first write, then track --- blockstore/splitstore/splitstore.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/blockstore/splitstore/splitstore.go b/blockstore/splitstore/splitstore.go index fd3ddb639..e258d0b99 100644 --- a/blockstore/splitstore/splitstore.go +++ b/blockstore/splitstore/splitstore.go @@ -311,10 +311,9 @@ func (s *SplitStore) Put(blk blocks.Block) error { s.txnLk.RLock() defer s.txnLk.RUnlock() - s.trackWrite(blk.Cid()) - err := s.hot.Put(blk) if err == nil { + s.trackWrite(blk.Cid()) s.trackTxnRef(blk.Cid()) } @@ -330,10 +329,9 @@ func (s *SplitStore) PutMany(blks []blocks.Block) error { s.txnLk.RLock() defer s.txnLk.RUnlock() - s.trackWriteMany(batch) - err := s.hot.PutMany(blks) if err == nil { + s.trackWriteMany(batch) s.trackTxnRefMany(batch) }