cmd, eth, rpc: fix some RPC issues with pending blocks

This commit is contained in:
Péter Szilágyi
2016-01-27 18:01:30 +02:00
parent a8fd0de0d3
commit 5da7ec7c18
5 changed files with 110 additions and 117 deletions

View File

@ -239,13 +239,13 @@ func (args *NewFilterArgs) UnmarshalJSON(data []byte) error {
return err
}
if raw.From == nil {
if raw.From == nil || raw.From.Int64() < 0 {
args.FromBlock = rpc.LatestBlockNumber
} else {
args.FromBlock = *raw.From
}
if raw.ToBlock == nil {
if raw.ToBlock == nil || raw.ToBlock.Int64() < 0 {
args.ToBlock = rpc.LatestBlockNumber
} else {
args.ToBlock = *raw.ToBlock