diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-10-30 00:42:55 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-10-30 00:42:55 +0800 |
commit | fc46cf337af614f4f9c96acd222089652fe7c76e (patch) | |
tree | 672ce52e11b768801f0b33f224424ba5f0fdc465 /xeth | |
parent | fd27f074feecec2f1e4c8041ff04ddac8d0ab6a3 (diff) | |
parent | fbdb44dcc17240a01b45e55d3aa4e4b8db0868cd (diff) | |
download | dexon-fc46cf337af614f4f9c96acd222089652fe7c76e.tar dexon-fc46cf337af614f4f9c96acd222089652fe7c76e.tar.gz dexon-fc46cf337af614f4f9c96acd222089652fe7c76e.tar.bz2 dexon-fc46cf337af614f4f9c96acd222089652fe7c76e.tar.lz dexon-fc46cf337af614f4f9c96acd222089652fe7c76e.tar.xz dexon-fc46cf337af614f4f9c96acd222089652fe7c76e.tar.zst dexon-fc46cf337af614f4f9c96acd222089652fe7c76e.zip |
Merge pull request #1946 from fjl/xeth-oom
Fix for xeth OOM issue
Diffstat (limited to 'xeth')
-rw-r--r-- | xeth/xeth.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go index f1e8cc5ee..35e6dd52d 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -113,19 +113,15 @@ func New(ethereum *eth.Ethereum, frontend Frontend) *XEth { if frontend == nil { xeth.frontend = dummyFrontend{} } - state, err := xeth.backend.BlockChain().State() - if err != nil { - return nil - } + state, _ := xeth.backend.BlockChain().State() xeth.state = NewState(xeth, state) - go xeth.start() - return xeth } func (self *XEth) start() { timer := time.NewTicker(2 * time.Second) + defer timer.Stop() done: for { select { @@ -171,8 +167,12 @@ done: } } -func (self *XEth) stop() { +// Stop releases any resources associated with self. +// It may not be called more than once. +func (self *XEth) Stop() { close(self.quit) + self.filterManager.Stop() + self.backend.Miner().Unregister(self.agent) } func cAddress(a []string) []common.Address { |