diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-24 00:41:50 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-24 00:41:50 +0800 |
commit | 1cf6ca8f10ab7dd5de29caf0d255c93cdec96994 (patch) | |
tree | 9e121387e41895b703ff88e5e65b231913d65201 | |
parent | 1e61b75cbf0830a72b40d0eed8f924cb7bb61aa3 (diff) | |
download | go-tangerine-1cf6ca8f10ab7dd5de29caf0d255c93cdec96994.tar go-tangerine-1cf6ca8f10ab7dd5de29caf0d255c93cdec96994.tar.gz go-tangerine-1cf6ca8f10ab7dd5de29caf0d255c93cdec96994.tar.bz2 go-tangerine-1cf6ca8f10ab7dd5de29caf0d255c93cdec96994.tar.lz go-tangerine-1cf6ca8f10ab7dd5de29caf0d255c93cdec96994.tar.xz go-tangerine-1cf6ca8f10ab7dd5de29caf0d255c93cdec96994.tar.zst go-tangerine-1cf6ca8f10ab7dd5de29caf0d255c93cdec96994.zip |
Add Close() method to EthereumApi
To close the handler for LDB
-rw-r--r-- | cmd/ethereum/js.go | 1 | ||||
-rw-r--r-- | rpc/api.go | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/cmd/ethereum/js.go b/cmd/ethereum/js.go index 88d16d6a8..6f0ac526f 100644 --- a/cmd/ethereum/js.go +++ b/cmd/ethereum/js.go @@ -91,6 +91,7 @@ func newJSRE(ethereum *eth.Ethereum, libPath string) *jsre { func (js *jsre) apiBindings() { ethApi := rpc.NewEthereumApi(js.xeth, js.ethereum.DataDir) + ethApi.Close() //js.re.Bind("jeth", rpc.NewJeth(ethApi, js.re.ToVal)) jeth := rpc.NewJeth(ethApi, js.re.ToVal, js.re) diff --git a/rpc/api.go b/rpc/api.go index 4cd88aa71..19bd9b707 100644 --- a/rpc/api.go +++ b/rpc/api.go @@ -44,6 +44,10 @@ func (api *EthereumApi) xethAtStateNum(num int64) *xeth.XEth { return api.xeth().AtStateNum(num) } +func (api *EthereumApi) Close() { + api.db.Close() +} + func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error { // Spec at https://github.com/ethereum/wiki/wiki/Generic-JSON-RPC rpclogger.Debugf("%s %s", req.Method, req.Params) |