aboutsummaryrefslogtreecommitdiffstats
path: root/eth/filters
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-01-28 00:01:30 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-02-03 16:35:59 +0800
commit5da7ec7c18b0e37cec0950e9656f6cdddc1ae60c (patch)
treeae78c0511eaead00800acc268d2782cb2ceef9b0 /eth/filters
parenta8fd0de0d344ce3828901fa47204a68971184684 (diff)
downloadgo-tangerine-5da7ec7c18b0e37cec0950e9656f6cdddc1ae60c.tar.gz
go-tangerine-5da7ec7c18b0e37cec0950e9656f6cdddc1ae60c.tar.zst
go-tangerine-5da7ec7c18b0e37cec0950e9656f6cdddc1ae60c.zip
cmd, eth, rpc: fix some RPC issues with pending blocks
Diffstat (limited to 'eth/filters')
-rw-r--r--eth/filters/api.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/eth/filters/api.go b/eth/filters/api.go
index f2b0ed32f..aa4c305a6 100644
--- a/eth/filters/api.go
+++ b/eth/filters/api.go
@@ -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