From 14a44d8f2c64c721d01575af620c406b1ba9595f Mon Sep 17 00:00:00 2001 From: Dennis Won Date: Mon, 9 Sep 2019 11:58:48 -0700 Subject: [PATCH] nit: fix error log consensus:marshaling error: json: unsupported type: chan []uint8 --- consensus/consensus_service.go | 3 +-- consensus/consensus_v2.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/consensus/consensus_service.go b/consensus/consensus_service.go index 70db72575..1ed8b70a7 100644 --- a/consensus/consensus_service.go +++ b/consensus/consensus_service.go @@ -412,13 +412,12 @@ func (consensus *Consensus) reportMetrics(block types.Block) { timeElapsed := endTime.Sub(startTime) numOfTxs := len(block.Transactions()) tps := float64(numOfTxs) / timeElapsed.Seconds() - utils.Logger().Info(). + consensus.getLogger().Info(). Int("numOfTXs", numOfTxs). Time("startTime", startTime). Time("endTime", endTime). Dur("timeElapsed", endTime.Sub(startTime)). Float64("TPS", tps). - Interface("consensus", consensus). Msg("TPS Report") // Post metrics diff --git a/consensus/consensus_v2.go b/consensus/consensus_v2.go index ddac280ac..4395c00b1 100644 --- a/consensus/consensus_v2.go +++ b/consensus/consensus_v2.go @@ -33,7 +33,7 @@ func (consensus *Consensus) handleMessageUpdate(payload []byte) { msg := &msg_pb.Message{} err := protobuf.Unmarshal(payload, msg) if err != nil { - utils.Logger().Error().Err(err).Interface("consensus", consensus).Msg("Failed to unmarshal message payload.") + consensus.getLogger().Error().Err(err).Msg("Failed to unmarshal message payload.") return } @@ -1161,7 +1161,6 @@ func (consensus *Consensus) Start(blockChannel chan *types.Block, stopChan chan consensus.getLogger().Debug(). Int("numTxs", len(newBlock.Transactions())). - Interface("consensus", consensus). Time("startTime", startTime). Int("publicKeys", len(consensus.PublicKeys)). Msg("[ConsensusMainLoop] STARTING CONSENSUS")