Skip to content

Commit 936b746

Browse files
committed
fix issues, close channels
1 parent 6bcce80 commit 936b746

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pkg/rpc/core/blocks.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,6 @@ func BlockchainInfo(ctx *rpctypes.Context, minHeight, maxHeight int64) (*ctypes.
277277

278278
blocks := make([]*cmttypes.BlockMeta, 0, maxHeight-minHeight+1)
279279
for _, block := range BlockIterator(maxHeight, minHeight) {
280-
if err != nil {
281-
return nil, err
282-
}
283280
if block.header != nil && block.data != nil {
284281
cmblockmeta, err := common.ToABCIBlockMeta(block.header, block.data)
285282
if err != nil {

pkg/rpc/core/utils.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ func BlockIterator(start int64, end int64) []BlockResponse {
170170
if err != nil {
171171
return blocks
172172
}
173+
defer rHeader.Close() //nolint:errcheck
174+
defer rData.Close() //nolint:errcheck
173175

174176
//we need to match the data to the header using the height, for that we use a map
175177
headerMap := make(map[uint64]*rlktypes.SignedHeader)

0 commit comments

Comments
 (0)