Skip to content

Commit

Permalink
fix abnormal case
Browse files Browse the repository at this point in the history
  • Loading branch information
tanZiWen committed Apr 1, 2020
1 parent 17c2524 commit 5904f19
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/store/ledgerstore/ledger_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,12 @@ func (this *LedgerStoreImp) GetBlockRootWithNewTxRoots(startHeight uint32, txRoo
if this.currBlockHeight > startHeight+uint32(len(txRoots))-1 {
// or return error?
return common.UINT256_EMPTY
} else if this.currBlockHeight+1 < startHeight {
// this should never happen in normal case
log.Fatalf("GetBlockRootWithNewTxRoots: invalid param: curr height: %d, start height: %d",
this.currBlockHeight, startHeight)

return common.UINT256_EMPTY
}

needs := txRoots[this.currBlockHeight+1-startHeight:]
Expand Down

0 comments on commit 5904f19

Please sign in to comment.