diff --git a/block/log.go b/block/log.go new file mode 100644 index 000000000..2eead6230 --- /dev/null +++ b/block/log.go @@ -0,0 +1,7 @@ +package block + +import ( + "github.com/tendermint/log15" +) + +var log = log15.New("module", "block") diff --git a/rpc/blocks.go b/rpc/blocks.go index e454cf281..c6d5e4c21 100644 --- a/rpc/blocks.go +++ b/rpc/blocks.go @@ -21,12 +21,13 @@ func BlockchainInfoHandler(w http.ResponseWriter, r *http.Request) { maxHeight = MinUint(blockStore.Height(), maxHeight) } if minHeight == 0 { - minHeight = MaxUint(1, maxHeight-20) + minHeight = MaxUint(1, MinUint(maxHeight-20, 1)) } blockMetas := []*BlockMeta{} for height := minHeight; height <= maxHeight; height++ { - blockMetas = append(blockMetas, blockStore.LoadBlockMeta(height)) + blockMeta := blockStore.LoadBlockMeta(height) + blockMetas = append(blockMetas, blockMeta) } res := BlockchainInfoResponse{