mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Revert "graphql: return error if block from>to (#28393)"
This reverts commit c637c84fc4.
This commit is contained in:
parent
26cd4e60f8
commit
cf2f02c1a4
1 changed files with 2 additions and 3 deletions
|
|
@ -42,7 +42,6 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
errBlockInvariant = errors.New("block objects must be instantiated with at least one of num or hash")
|
errBlockInvariant = errors.New("block objects must be instantiated with at least one of num or hash")
|
||||||
errInvalidBlockRange = errors.New("invalid from and to block combination: from > to")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Long int64
|
type Long int64
|
||||||
|
|
@ -1334,7 +1333,7 @@ func (r *Resolver) Blocks(ctx context.Context, args struct {
|
||||||
to = rpc.BlockNumber(r.backend.CurrentBlock().Number.Int64())
|
to = rpc.BlockNumber(r.backend.CurrentBlock().Number.Int64())
|
||||||
}
|
}
|
||||||
if to < from {
|
if to < from {
|
||||||
return nil, errInvalidBlockRange
|
return []*Block{}, nil
|
||||||
}
|
}
|
||||||
var ret []*Block
|
var ret []*Block
|
||||||
for i := from; i <= to; i++ {
|
for i := from; i <= to; i++ {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue