From 20cbe44db3276131862d565ad6508e26e901edca Mon Sep 17 00:00:00 2001 From: senthil Date: Mon, 17 Sep 2018 09:49:51 +0530 Subject: [PATCH] code hygiene: disable missingData recon upfront Fix code as per comments posted in https://gerrit.hyperledger.org/r/c/26332/ FAB-12024 #done Change-Id: Ia83be34035393410b8c79967d0e783067a9d43ed Signed-off-by: senthil --- core/ledger/ledgerstorage/store.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/ledger/ledgerstorage/store.go b/core/ledger/ledgerstorage/store.go index 6fe401ae7a1..9a824386542 100644 --- a/core/ledger/ledgerstorage/store.go +++ b/core/ledger/ledgerstorage/store.go @@ -91,6 +91,11 @@ func (s *Store) CommitWithPvtData(blockAndPvtdata *ledger.BlockAndPvtData) error blockNum := blockAndPvtdata.Block.Header.Number missingDataList := blockAndPvtdata.Missing + if !isMissingDataReconEnabled { + // should not store any entries for missing data + missingDataList = nil + } + s.rwlock.Lock() defer s.rwlock.Unlock() @@ -108,10 +113,6 @@ func (s *Store) CommitWithPvtData(blockAndPvtdata *ledger.BlockAndPvtData) error for _, v := range blockAndPvtdata.BlockPvtData { pvtdata = append(pvtdata, v) } - if !isMissingDataReconEnabled { - // should not store any entries for missing data - missingDataList = nil - } if err := s.pvtdataStore.Prepare(blockAndPvtdata.Block.Header.Number, pvtdata, missingDataList); err != nil { return err }