diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-03-17 14:28:19 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:23 +0800 |
commit | 19c6af0154aa305288ab1ca2c3e716176dbd9563 (patch) | |
tree | 0976410e6aa0b58da877978699e11244037b31e9 /dex/backend.go | |
parent | 5993c56b2835f3ac056707b153ed5c84855228d5 (diff) | |
download | go-tangerine-19c6af0154aa305288ab1ca2c3e716176dbd9563.tar go-tangerine-19c6af0154aa305288ab1ca2c3e716176dbd9563.tar.gz go-tangerine-19c6af0154aa305288ab1ca2c3e716176dbd9563.tar.bz2 go-tangerine-19c6af0154aa305288ab1ca2c3e716176dbd9563.tar.lz go-tangerine-19c6af0154aa305288ab1ca2c3e716176dbd9563.tar.xz go-tangerine-19c6af0154aa305288ab1ca2c3e716176dbd9563.tar.zst go-tangerine-19c6af0154aa305288ab1ca2c3e716176dbd9563.zip |
dex: properly start and stop the block proposer module (#264)
Stop blockproposer in the Stop() method of node service so the process
doens't hang.
Diffstat (limited to 'dex/backend.go')
-rw-r--r-- | dex/backend.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/dex/backend.go b/dex/backend.go index 0f68163c0..e90c3ad10 100644 --- a/dex/backend.go +++ b/dex/backend.go @@ -251,6 +251,10 @@ func (s *Dexon) Start(srvr *p2p.Server) error { } // Start the networking layer and the light server if requested s.protocolManager.Start(srvr, maxPeers) + + if s.config.BlockProposerEnabled { + s.bp.Start() + } return nil } @@ -260,17 +264,12 @@ func (s *Dexon) Stop() error { if s.indexer != nil { s.indexer.Stop() } + if s.config.BlockProposerEnabled { + s.bp.Stop() + } return nil } -func (s *Dexon) StartProposing() error { - return s.bp.Start() -} - -func (s *Dexon) StopProposing() { - s.bp.Stop() -} - func (s *Dexon) IsCoreSyncing() bool { return s.bp.IsCoreSyncing() } |