Skip to content

Commit

Permalink
code hygiene: disable missingData recon upfront
Browse files Browse the repository at this point in the history
Fix code as per comments posted in
https://gerrit.hyperledger.org/r/c/26332/

FAB-12024 #done

Change-Id: Ia83be34035393410b8c79967d0e783067a9d43ed
Signed-off-by: senthil <cendhu@gmail.com>
  • Loading branch information
cendhu committed Sep 17, 2018
1 parent 10b5eff commit 20cbe44
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/ledger/ledgerstorage/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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
}
Expand Down

0 comments on commit 20cbe44

Please sign in to comment.