set logger for peer's MConnection

This commit is contained in:
Anton Kaliaev
2017-11-09 14:57:40 -05:00
parent 9c4d533695
commit a1cdc2b68a
2 changed files with 6 additions and 1 deletions

View File

@ -390,7 +390,6 @@ func (conR *ConsensusReactor) broadcastProposalHeartbeatMessage(heartbeat types.
}
func (conR *ConsensusReactor) broadcastNewRoundStep(rs *cstypes.RoundState) {
nrsMsg, csMsg := makeRoundStepMessages(rs)
if nrsMsg != nil {
conR.Switch.Broadcast(StateChannel, struct{ ConsensusMessage }{nrsMsg})

View File

@ -11,6 +11,7 @@ import (
crypto "github.com/tendermint/go-crypto"
wire "github.com/tendermint/go-wire"
cmn "github.com/tendermint/tmlibs/common"
"github.com/tendermint/tmlibs/log"
)
// Peer is an interface representing a peer connected on a reactor.
@ -136,6 +137,11 @@ func newPeerFromConnAndConfig(rawConn net.Conn, outbound bool, reactorsByCh map[
return p, nil
}
func (p *peer) SetLogger(l log.Logger) {
p.Logger = l
p.mconn.SetLogger(l)
}
// CloseConn should be used when the peer was created, but never started.
func (p *peer) CloseConn() {
p.conn.Close()