aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-05-18 22:16:10 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-05-18 22:16:10 +0800
commitd381d9a74cc2cb4e8cebf21aa9e4927a6e1867d6 (patch)
treed28b24651bc390eb70f6ef472712ece2b5cc3b5f
parent67d44519ce4344d5ee5f7cf37dd785ead70e8453 (diff)
downloadgo-tangerine-d381d9a74cc2cb4e8cebf21aa9e4927a6e1867d6.tar.gz
go-tangerine-d381d9a74cc2cb4e8cebf21aa9e4927a6e1867d6.tar.zst
go-tangerine-d381d9a74cc2cb4e8cebf21aa9e4927a6e1867d6.zip
Return nil for certain fields on eth_getBlockByNumber pending
-rw-r--r--rpc/api.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/rpc/api.go b/rpc/api.go
index b59253ef7..47409b4af 100644
--- a/rpc/api.go
+++ b/rpc/api.go
@@ -231,6 +231,13 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
block := api.xeth().EthBlockByNumber(args.BlockNumber)
br := NewBlockRes(block, args.IncludeTxs)
+ if args.BlockNumber == -2 {
+ br.BlockHash = nil
+ br.BlockNumber = nil
+ br.Miner = nil
+ br.Nonce = nil
+ br.LogsBloom = nil
+ }
*reply = br
case "eth_getTransactionByHash":
args := new(HashArgs)