diff --git a/blockstore/splitstore/splitstore.go b/blockstore/splitstore/splitstore.go index d2928041c..4780fcdb4 100644 --- a/blockstore/splitstore/splitstore.go +++ b/blockstore/splitstore/splitstore.go @@ -494,7 +494,7 @@ func (s *SplitStore) View(ctx context.Context, cid cid.Cid, cb func([]byte) erro } // critical section - s.txnLk.RLock() + s.txnLk.RLock() // the lock is released in protectView if we are not in critical section if s.txnMarkSet != nil { has, err := s.txnMarkSet.Has(cid) s.txnLk.RUnlock() @@ -509,7 +509,6 @@ func (s *SplitStore) View(ctx context.Context, cid cid.Cid, cb func([]byte) erro return s.cold.View(ctx, cid, cb) } - s.txnLk.RUnlock() // views are (optimistically) protected two-fold: // - if there is an active transaction, then the reference is protected. diff --git a/blockstore/splitstore/splitstore_compact.go b/blockstore/splitstore/splitstore_compact.go index bdb0f882e..26f662bda 100644 --- a/blockstore/splitstore/splitstore_compact.go +++ b/blockstore/splitstore/splitstore_compact.go @@ -156,7 +156,7 @@ func (s *SplitStore) protectTipSets(apply []*types.TipSet) { // transactionally protect a view func (s *SplitStore) protectView(c cid.Cid) { - s.txnLk.RLock() + // the txnLk is held for read defer s.txnLk.RUnlock() if s.txnActive {