aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-14 02:32:11 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-14 02:32:11 +0800
commitf49e17eb392e7cabacc81146882024fd0e10a1d9 (patch)
tree2cd7d7f3040ecd33d6fd962dcad7e8e27b5299fa /rpc
parente3b64d70c212d893c147b8af62abe5c03fb2f492 (diff)
downloaddexon-f49e17eb392e7cabacc81146882024fd0e10a1d9.tar
dexon-f49e17eb392e7cabacc81146882024fd0e10a1d9.tar.gz
dexon-f49e17eb392e7cabacc81146882024fd0e10a1d9.tar.bz2
dexon-f49e17eb392e7cabacc81146882024fd0e10a1d9.tar.lz
dexon-f49e17eb392e7cabacc81146882024fd0e10a1d9.tar.xz
dexon-f49e17eb392e7cabacc81146882024fd0e10a1d9.tar.zst
dexon-f49e17eb392e7cabacc81146882024fd0e10a1d9.zip
Return null coinbase when accounts not created
Was previously returning nonsensical “0x”
Diffstat (limited to 'rpc')
-rw-r--r--rpc/api.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/rpc/api.go b/rpc/api.go
index af9f10530..ec827a77b 100644
--- a/rpc/api.go
+++ b/rpc/api.go
@@ -490,7 +490,13 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
case "net_peerCount":
*reply = toHex(big.NewInt(int64(p.xeth().PeerCount())).Bytes())
case "eth_coinbase":
- *reply = p.xeth().Coinbase()
+ // TODO handling of empty coinbase due to lack of accounts
+ res := p.xeth().Coinbase()
+ if res == "0x" || res == "0x0" {
+ *reply = nil
+ } else {
+ *reply = res
+ }
case "eth_mining":
*reply = p.xeth().IsMining()
case "eth_gasPrice":