Skip to content

Commit

Permalink
Check error in rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
cpacia committed Oct 19, 2017
1 parent ba69230 commit 943bc48
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ func (b *Blockchain) Rollback(t time.Time) error {
rollbackHeight := uint32(0)
for {
sh, err = b.db.GetPreviousHeader(sh.header)
if err != nil {
return err
}
checkHash := sh.header.BlockHash()
// If we rolled back to the checkpoint then stop here and set the checkpoint as the tip
if checkHash.IsEqual(&checkPointHash) {
Expand Down

0 comments on commit 943bc48

Please sign in to comment.