Skip to content

Commit

Permalink
Remove redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
lewtran committed Nov 24, 2020
1 parent d0ab365 commit fd986c1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
6 changes: 0 additions & 6 deletions dualchain/blockchain/dual_block_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,6 @@ func (dbo *DualBlockOperations) SaveBlock(block *types.Block, blockParts *types.
if g, w := height, dbo.Height()+1; g != w {
common.PanicSanity(common.Fmt("DualBlockOperations can only save contiguous blocks. Wanted %v, got %v", w, g))
}

// Save block
if height != dbo.Height()+1 {
common.PanicSanity(common.Fmt("DualBlockOperations can only save contiguous blocks. Wanted %v, got %v", dbo.Height()+1, height))
}

// TODO(kiendn): WriteBlockWithoutState returns an error, write logic check if error appears
if err := dbo.blockchain.WriteBlockWithoutState(block); err != nil {
common.PanicSanity(common.Fmt("WriteBlockWithoutState fails with error %v", err))
Expand Down
6 changes: 0 additions & 6 deletions mainchain/blockchain/block_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,6 @@ func (bo *BlockOperations) SaveBlock(block *types.Block, blockParts *types.PartS
if g, w := height, bo.Height()+1; g != w {
common.PanicSanity(common.Fmt("BlockOperations can only save contiguous blocks. Wanted %v, got %v", w, g))
}

// Save block
if height != bo.Height()+1 {
common.PanicSanity(common.Fmt("BlockOperations can only save contiguous blocks. Wanted %v, got %v", bo.Height()+1, height))
}

if !blockParts.IsComplete() {
panic("BlockOperations can only save complete block part sets")
}
Expand Down

0 comments on commit fd986c1

Please sign in to comment.