mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 12:11:58 +00:00
rpc/block fix
This commit is contained in:
7
block/log.go
Normal file
7
block/log.go
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package block
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/tendermint/log15"
|
||||||
|
)
|
||||||
|
|
||||||
|
var log = log15.New("module", "block")
|
@@ -21,12 +21,13 @@ func BlockchainInfoHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
maxHeight = MinUint(blockStore.Height(), maxHeight)
|
maxHeight = MinUint(blockStore.Height(), maxHeight)
|
||||||
}
|
}
|
||||||
if minHeight == 0 {
|
if minHeight == 0 {
|
||||||
minHeight = MaxUint(1, maxHeight-20)
|
minHeight = MaxUint(1, MinUint(maxHeight-20, 1))
|
||||||
}
|
}
|
||||||
|
|
||||||
blockMetas := []*BlockMeta{}
|
blockMetas := []*BlockMeta{}
|
||||||
for height := minHeight; height <= maxHeight; height++ {
|
for height := minHeight; height <= maxHeight; height++ {
|
||||||
blockMetas = append(blockMetas, blockStore.LoadBlockMeta(height))
|
blockMeta := blockStore.LoadBlockMeta(height)
|
||||||
|
blockMetas = append(blockMetas, blockMeta)
|
||||||
}
|
}
|
||||||
|
|
||||||
res := BlockchainInfoResponse{
|
res := BlockchainInfoResponse{
|
||||||
|
Reference in New Issue
Block a user