Skip to content

Commit

Permalink
Merge "[FAB-4980] Account for the pvtdata during recovery"
Browse files Browse the repository at this point in the history
  • Loading branch information
C0rWin authored and Gerrit Code Review committed Sep 11, 2017
2 parents bd23071 + ccdce22 commit f46a2d4
Show file tree
Hide file tree
Showing 2 changed files with 229 additions and 315 deletions.
6 changes: 3 additions & 3 deletions core/ledger/kvledger/kv_ledger.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ func (l *kvLedger) recoverDBs() error {
//state DB or history DB or both
func (l *kvLedger) recommitLostBlocks(firstBlockNum uint64, lastBlockNum uint64, recoverables ...recoverable) error {
var err error
var block *common.Block
var blockAndPvtdata *ledger.BlockAndPvtData
for blockNumber := firstBlockNum; blockNumber <= lastBlockNum; blockNumber++ {
if block, err = l.GetBlockByNumber(blockNumber); err != nil {
if blockAndPvtdata, err = l.GetPvtDataAndBlockByNum(blockNumber, nil); err != nil {
return err
}
for _, r := range recoverables {
if err := r.CommitLostBlock(&ledger.BlockAndPvtData{Block: block}); err != nil {
if err := r.CommitLostBlock(blockAndPvtdata); err != nil {
return err
}
}
Expand Down
Loading

0 comments on commit f46a2d4

Please sign in to comment.