diff --git a/e2pg/e2pg.go b/e2pg/e2pg.go index eb2494f4..45a5c173 100644 --- a/e2pg/e2pg.go +++ b/e2pg/e2pg.go @@ -588,7 +588,7 @@ func (r *destRange) load(ctx context.Context, pg wpg.Conn, name, srcName string) func (r *destRange) filter(blks []eth.Block) []eth.Block { switch { - case r.stop == 0: + case r.start == 0 && r.stop == 0: return blks case len(blks) == 0: return blks diff --git a/e2pg/e2pg_test.go b/e2pg/e2pg_test.go index 3d92261b..ec61af81 100644 --- a/e2pg/e2pg_test.go +++ b/e2pg/e2pg_test.go @@ -630,6 +630,12 @@ func TestDestRanges_Filter(t *testing.T) { r: destRange{start: 15, stop: 10}, want: []eth.Block(nil), }, + { + desc: "[0, 10] -> [5, 0]", + input: br(0, 10), + r: destRange{start: 5, stop: 0}, + want: []eth.Block(nil), + }, } for _, tc := range cases { got := tc.r.filter(tc.input)