Add Close() method to EthereumApi

To close the handler for LDB
pull/553/head
Taylor Gerring 10 years ago
parent 1e61b75cbf
commit 1cf6ca8f10
  1. 1
      cmd/ethereum/js.go
  2. 4
      rpc/api.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)

@ -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)

Loading…
Cancel
Save