From d64a48e0ee3419c48c1a2c91c20c34ccc48c53d2 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Fri, 20 Oct 2017 23:56:21 +0400 Subject: [PATCH] set logger on blockchain pool --- blockchain/pool.go | 4 +--- blockchain/reactor.go | 11 +++++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/blockchain/pool.go b/blockchain/pool.go index ca15c9910..aac4c77c3 100644 --- a/blockchain/pool.go +++ b/blockchain/pool.go @@ -69,9 +69,7 @@ func (pool *BlockPool) OnStart() error { return nil } -func (pool *BlockPool) OnStop() { - pool.BaseService.OnStop() -} +func (pool *BlockPool) OnStop() {} // Run spawns requesters as needed. func (pool *BlockPool) makeRequestersRoutine() { diff --git a/blockchain/reactor.go b/blockchain/reactor.go index 9cc01fbac..6ff010038 100644 --- a/blockchain/reactor.go +++ b/blockchain/reactor.go @@ -12,6 +12,7 @@ import ( sm "github.com/tendermint/tendermint/state" "github.com/tendermint/tendermint/types" cmn "github.com/tendermint/tmlibs/common" + "github.com/tendermint/tmlibs/log" ) const ( @@ -79,7 +80,13 @@ func NewBlockchainReactor(state *sm.State, proxyAppConn proxy.AppConnConsensus, return bcR } -// OnStart implements BaseService +// SetLogger implements cmn.Service by setting the logger on reactor and pool. +func (bcR *BlockchainReactor) SetLogger(l log.Logger) { + bcR.BaseService.Logger = l + bcR.pool.Logger = l +} + +// OnStart implements cmn.Service. func (bcR *BlockchainReactor) OnStart() error { bcR.BaseReactor.OnStart() if bcR.fastSync { @@ -92,7 +99,7 @@ func (bcR *BlockchainReactor) OnStart() error { return nil } -// OnStop implements BaseService +// OnStop implements cmn.Service. func (bcR *BlockchainReactor) OnStop() { bcR.BaseReactor.OnStop() bcR.pool.Stop()