Browse Source

fix pr suggestion

pull/8101/head
HuangYi 3 years ago
parent
commit
3810b29f38
No known key found for this signature in database GPG Key ID: 58776091521E8B17
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      internal/store/store.go

+ 2
- 2
internal/store/store.go View File

@ -580,7 +580,7 @@ func (bs *BlockStore) Close() error {
func (bs *BlockStore) Rollback() error { func (bs *BlockStore) Rollback() error {
height := bs.Height() height := bs.Height()
if height <= 0 { if height <= 0 {
return fmt.Errorf("can't rollback height %v", height)
return fmt.Errorf("can't rollback height %d", height)
} }
pruned, err := bs.pruneRange(blockMetaKey(height), blockMetaKey(height+1), removeBlockHash) pruned, err := bs.pruneRange(blockMetaKey(height), blockMetaKey(height+1), removeBlockHash)
@ -589,7 +589,7 @@ func (bs *BlockStore) Rollback() error {
} }
if pruned != 1 { if pruned != 1 {
return fmt.Errorf("the number of rollbacked blocks don't match %v", pruned)
return fmt.Errorf("the number of rollbacked blocks don't match %d", pruned)
} }
if _, err := bs.pruneRange(blockPartKey(height, 0), blockPartKey(height+1, 0), nil); err != nil { if _, err := bs.pruneRange(blockPartKey(height, 0), blockPartKey(height+1, 0), nil); err != nil {


Loading…
Cancel
Save