mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-07 22:05:18 +00:00
make crc32c a global var
change echo format in build.sh script
This commit is contained in:
@@ -23,6 +23,8 @@ import (
|
||||
"github.com/tendermint/tendermint/version"
|
||||
)
|
||||
|
||||
var crc32c = crc32.MakeTable(crc32.Castagnoli)
|
||||
|
||||
// Functionality to replay blocks and messages on recovery from a crash.
|
||||
// There are two general failure scenarios: failure during consensus, and failure while applying the block.
|
||||
// The former is handled by the WAL, the latter by the proxyApp Handshake on restart,
|
||||
@@ -50,7 +52,6 @@ func (cs *ConsensusState) readReplayMessage(msgBytes []byte, newStepCh chan inte
|
||||
}
|
||||
// check checksum
|
||||
innerMsgBytes := wire.JSONBytes(msg.Msg)
|
||||
crc32c := crc32.MakeTable(crc32.Castagnoli)
|
||||
crc := crc32.Checksum(innerMsgBytes, crc32c)
|
||||
if crc != msg.CRC {
|
||||
return fmt.Errorf("Checksums do not match. Original: %v, but calculated: %v", msg.CRC, crc)
|
||||
|
||||
@@ -87,7 +87,6 @@ func (wal *WAL) Save(wmsg WALMessage) {
|
||||
}
|
||||
// Write the wal message
|
||||
innerMsgBytes := wire.JSONBytes(wmsg)
|
||||
crc32c := crc32.MakeTable(crc32.Castagnoli)
|
||||
crc := crc32.Checksum(innerMsgBytes, crc32c)
|
||||
wmsgSize := uint32(len(innerMsgBytes))
|
||||
var wmsgBytes = wire.JSONBytes(TimedWALMessage{time.Now(), crc, wmsgSize, wmsg})
|
||||
|
||||
Reference in New Issue
Block a user