From e57cad6c3f1b74ce3c6e80ad0b62a8167eb353ec Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Fri, 15 Dec 2017 11:42:53 -0600 Subject: [PATCH] correct maxMsgSizeBytes --- consensus/wal.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/consensus/wal.go b/consensus/wal.go index 5c45961f..7dc8d2e8 100644 --- a/consensus/wal.go +++ b/consensus/wal.go @@ -18,7 +18,8 @@ import ( ) const ( - maxMsgSizeBytes = 1024 // 1MB, must be greater than BlockPartSizeBytes + // must be greater than params.BlockGossipParams.BlockPartSizeBytes + a few bytes + maxMsgSizeBytes = 1024 * 1024 // 1MB ) //-------------------------------------------------------- @@ -279,7 +280,7 @@ func (dec *WALDecoder) Decode() (*TimedWALMessage, error) { length := binary.BigEndian.Uint32(b) if length > maxMsgSizeBytes { - return nil, DataCorruptionError{fmt.Errorf("length %d exceeded maximum possible value %d", length, maxMsgSizeBytes)} + return nil, DataCorruptionError{fmt.Errorf("length %d exceeded maximum possible value of %d bytes", length, maxMsgSizeBytes)} } data := make([]byte, length)