Browse Source

correct maxMsgSizeBytes

pull/965/head
Anton Kaliaev 7 years ago
parent
commit
e57cad6c3f
No known key found for this signature in database GPG Key ID: 7B6881D965918214
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      consensus/wal.go

+ 3
- 2
consensus/wal.go View File

@ -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)


Loading…
Cancel
Save