@@ -128,13 +128,13 @@ func getHeightFromEntry(field string, value []byte) (uint64, error) {
128
128
return 0 , fmt .Errorf ("unknown field: %s" , field )
129
129
}
130
130
131
- type BlockFilter struct { // needs this for the Filter interface
131
+ type blockFilter struct { // needs this for the Filter interface
132
132
start int64
133
133
end int64
134
134
field string //need this field for differentiation between getting headers and getting data
135
135
}
136
136
137
- func (f * BlockFilter ) Filter (e dsq.Entry ) bool {
137
+ func (f * blockFilter ) Filter (e dsq.Entry ) bool {
138
138
height , err := getHeightFromEntry (f .field , e .Value )
139
139
if err != nil {
140
140
return false
@@ -148,8 +148,8 @@ func BlockIterator(start int64, end int64) []BlockResponse {
148
148
if ! ok {
149
149
return blocks
150
150
}
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" }
153
153
154
154
// we need to do two queries, one for the block header and one for the block data
155
155
qHeader := dsq.Query {
@@ -207,6 +207,8 @@ func BlockIterator(start int64, end int64) []BlockResponse {
207
207
return blocks
208
208
}
209
209
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.
210
212
type BlockResponse struct {
211
213
header * rlktypes.SignedHeader
212
214
data * rlktypes.Data
0 commit comments