output msg only once during start

This commit is contained in:
Anton Kaliaev 2018-06-19 11:40:40 +04:00
parent 4b2348f697
commit 70d973016e
No known key found for this signature in database
GPG Key ID: 7B6881D965918214
1 changed files with 8 additions and 1 deletions

View File

@ -45,6 +45,14 @@ func (memR *MempoolReactor) SetLogger(l log.Logger) {
memR.Mempool.SetLogger(l)
}
// OnStart implements p2p.BaseReactor.
func (memR *MempoolReactor) OnStart() error {
if !memR.config.Broadcast {
memR.Logger.Info("Tx broadcasting is disabled")
}
return nil
}
// GetChannels implements Reactor.
// It returns the list of channels for this reactor.
func (memR *MempoolReactor) GetChannels() []*p2p.ChannelDescriptor {
@ -103,7 +111,6 @@ type PeerState interface {
// Send new mempool txs to peer.
func (memR *MempoolReactor) broadcastTxRoutine(peer p2p.Peer) {
if !memR.config.Broadcast {
memR.Logger.Info("Tx broadcasting is disabled")
return
}