Skip to content

Commit 6edd4c6

Browse files
committed
make filter private
1 parent 936b746 commit 6edd4c6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pkg/rpc/core/utils.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ func getHeightFromEntry(field string, value []byte) (uint64, error) {
128128
return 0, fmt.Errorf("unknown field: %s", field)
129129
}
130130

131-
type BlockFilter struct { // needs this for the Filter interface
131+
type blockFilter struct { // needs this for the Filter interface
132132
start int64
133133
end int64
134134
field string //need this field for differentiation between getting headers and getting data
135135
}
136136

137-
func (f *BlockFilter) Filter(e dsq.Entry) bool {
137+
func (f *blockFilter) Filter(e dsq.Entry) bool {
138138
height, err := getHeightFromEntry(f.field, e.Value)
139139
if err != nil {
140140
return false
@@ -148,8 +148,8 @@ func BlockIterator(start int64, end int64) []BlockResponse {
148148
if !ok {
149149
return blocks
150150
}
151-
filterData := &BlockFilter{start: start, end: end, field: "data"}
152-
filterHeader := &BlockFilter{start: start, end: end, field: "header"}
151+
filterData := &blockFilter{start: start, end: end, field: "data"}
152+
filterHeader := &blockFilter{start: start, end: end, field: "header"}
153153

154154
// we need to do two queries, one for the block header and one for the block data
155155
qHeader := dsq.Query{
@@ -207,6 +207,8 @@ func BlockIterator(start int64, end int64) []BlockResponse {
207207
return blocks
208208
}
209209

210+
// BlockResponse represents a paired block header and data for efficient iteration.
211+
// It's returned by BlockIterator to provide access to both components of a block.
210212
type BlockResponse struct {
211213
header *rlktypes.SignedHeader
212214
data *rlktypes.Data

0 commit comments

Comments
 (0)