@@ -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.
210212type BlockResponse struct {
211213 header * rlktypes.SignedHeader
212214 data * rlktypes.Data
0 commit comments