Log underlying RLP error if RLP encoding fails

pull/1550/head
Eugene Kim 5 years ago
parent f7900cb908
commit e0eb0ef7a7
  1. 8
      consensus/consensus_v2.go

@ -92,12 +92,16 @@ func (consensus *Consensus) announce(block *types.Block) {
// prepare message and broadcast to validators
encodedBlock, err := rlp.EncodeToBytes(block)
if err != nil {
consensus.getLogger().Debug().Msg("[Announce] Failed encoding block")
consensus.getLogger().Debug().
Err(err).
Msg("[Announce] Failed encoding block")
return
}
encodedBlockHeader, err := rlp.EncodeToBytes(block.Header())
if err != nil {
consensus.getLogger().Debug().Msg("[Announce] Failed encoding block header")
consensus.getLogger().Debug().
Err(err).
Msg("[Announce] Failed encoding block header")
return
}

Loading…
Cancel
Save