ints: stricter numbers (#4939)

This commit is contained in:
Marko
2020-06-04 16:34:56 +02:00
committed by GitHub
parent 7c576f02ab
commit a88537bb88
56 changed files with 738 additions and 674 deletions
+3 -3
View File
@@ -80,7 +80,7 @@ func (bs *BlockStore) LoadBlock(height int64) *types.Block {
var block = new(types.Block)
buf := []byte{}
for i := 0; i < blockMeta.BlockID.PartsHeader.Total; i++ {
for i := 0; i < int(blockMeta.BlockID.PartsHeader.Total); i++ {
part := bs.LoadBlockPart(height, i)
buf = append(buf, part.Bytes...)
}
@@ -235,7 +235,7 @@ func (bs *BlockStore) PruneBlocks(height int64) (uint64, error) {
batch.Delete(calcBlockHashKey(meta.BlockID.Hash))
batch.Delete(calcBlockCommitKey(h))
batch.Delete(calcSeenCommitKey(h))
for p := 0; p < meta.BlockID.PartsHeader.Total; p++ {
for p := 0; p < int(meta.BlockID.PartsHeader.Total); p++ {
batch.Delete(calcBlockPartKey(h, p))
}
pruned++
@@ -286,7 +286,7 @@ func (bs *BlockStore) SaveBlock(block *types.Block, blockParts *types.PartSet, s
bs.db.Set(calcBlockHashKey(hash), []byte(fmt.Sprintf("%d", height)))
// Save block parts
for i := 0; i < blockParts.Total(); i++ {
for i := 0; i < int(blockParts.Total()); i++ {
part := blockParts.GetPart(i)
bs.saveBlockPart(height, i, part)
}