Browse Source

rpc/block fix

pull/39/head
Jae Kwon 10 years ago
parent
commit
e2f622b08a
2 changed files with 10 additions and 2 deletions
  1. +7
    -0
      block/log.go
  2. +3
    -2
      rpc/blocks.go

+ 7
- 0
block/log.go View File

@ -0,0 +1,7 @@
package block
import (
"github.com/tendermint/log15"
)
var log = log15.New("module", "block")

+ 3
- 2
rpc/blocks.go View File

@ -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{


Loading…
Cancel
Save