aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jsre/pp_js.go2
-rw-r--r--rpc/api/net.go5
-rw-r--r--rpc/api/net_js.go4
-rw-r--r--rpc/api/txpool_js.go3
4 files changed, 11 insertions, 3 deletions
diff --git a/jsre/pp_js.go b/jsre/pp_js.go
index d29e21cfa..723d74d5f 100644
--- a/jsre/pp_js.go
+++ b/jsre/pp_js.go
@@ -116,7 +116,7 @@ var isBigNumber = function (object) {
var result = typeof BigNumber !== 'undefined' && object instanceof BigNumber;
if (!result) {
- if(typeof(object) === "object") {
+ if (typeof(object) === "object" && object.constructor != null) {
result = object.constructor.toString().indexOf("function BigNumber(") == 0;
}
}
diff --git a/rpc/api/net.go b/rpc/api/net.go
index dbed9e11e..d8b636b02 100644
--- a/rpc/api/net.go
+++ b/rpc/api/net.go
@@ -32,6 +32,7 @@ var (
netMapping = map[string]nethandler{
"net_peerCount": (*netApi).PeerCount,
"net_listening": (*netApi).IsListening,
+ "net_version": (*netApi).Version,
}
)
@@ -93,3 +94,7 @@ func (self *netApi) IsListening(req *shared.Request) (interface{}, error) {
return self.xeth.IsListening(), nil
}
+func (self *netApi) Version(req *shared.Request) (interface{}, error) {
+ return self.xeth.NetworkVersion(), nil
+}
+
diff --git a/rpc/api/net_js.go b/rpc/api/net_js.go
index 391039eea..acfd35fce 100644
--- a/rpc/api/net_js.go
+++ b/rpc/api/net_js.go
@@ -30,6 +30,10 @@ web3._extend({
],
properties:
[
+ new web3._extend.Property({
+ name: 'version',
+ getter: 'net_version'
+ })
]
});
`
diff --git a/rpc/api/txpool_js.go b/rpc/api/txpool_js.go
index ef9a0487c..f0473ffec 100644
--- a/rpc/api/txpool_js.go
+++ b/rpc/api/txpool_js.go
@@ -26,8 +26,7 @@ web3._extend({
[
new web3._extend.Property({
name: 'status',
- getter: 'txpool_status',
- outputFormatter: function(obj) { return obj; }
+ getter: 'txpool_status'
})
]
});