aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-25 19:09:55 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-25 19:09:55 +0800
commit2b93843d86532db3d6b530daf15c04fde0b73eba (patch)
treef9a5fb60cde74d70ba88e2bbe58f9f51391322f7 /rpc/api.go
parentc956bcb13c287baf1d4ae1b2c9ae83d43423d67f (diff)
downloadgo-tangerine-2b93843d86532db3d6b530daf15c04fde0b73eba.tar
go-tangerine-2b93843d86532db3d6b530daf15c04fde0b73eba.tar.gz
go-tangerine-2b93843d86532db3d6b530daf15c04fde0b73eba.tar.bz2
go-tangerine-2b93843d86532db3d6b530daf15c04fde0b73eba.tar.lz
go-tangerine-2b93843d86532db3d6b530daf15c04fde0b73eba.tar.xz
go-tangerine-2b93843d86532db3d6b530daf15c04fde0b73eba.tar.zst
go-tangerine-2b93843d86532db3d6b530daf15c04fde0b73eba.zip
Improve protocol version reporting
Diffstat (limited to 'rpc/api.go')
-rw-r--r--rpc/api.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/rpc/api.go b/rpc/api.go
index 37ab6e1d4..aa5b54199 100644
--- a/rpc/api.go
+++ b/rpc/api.go
@@ -49,7 +49,7 @@ func (api *EthereumApi) Close() {
}
func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error {
- // Spec at https://github.com/ethereum/wiki/wiki/Generic-JSON-RPC
+ // Spec at https://github.com/ethereum/wiki/wiki/JSON-RPC
rpclogger.Debugf("%s %s", req.Method, req.Params)
switch req.Method {
@@ -68,6 +68,8 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
case "net_peerCount":
v := api.xeth().PeerCount()
*reply = common.ToHex(big.NewInt(int64(v)).Bytes())
+ case "eth_version":
+ *reply = api.xeth().EthVersion()
case "eth_coinbase":
// TODO handling of empty coinbase due to lack of accounts
res := api.xeth().Coinbase()
@@ -406,6 +408,8 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
res, _ := api.db.Get([]byte(args.Database + args.Key))
*reply = common.ToHex(res)
+ case "shh_version":
+ *reply = api.xeth().WhisperVersion()
case "shh_post":
args := new(WhisperMessageArgs)
if err := json.Unmarshal(req.Params, &args); err != nil {