cs: test new limits

This commit is contained in:
Anton Kaliaev
2019-10-29 11:00:56 -07:00
committed by Jack Zampolin
parent c38dbdb640
commit 564d6a203a
2 changed files with 84 additions and 73 deletions
+3
View File
@@ -1453,6 +1453,9 @@ func (m *NewValidBlockMessage) ValidateBasic() error {
if err := m.BlockPartsHeader.ValidateBasic(); err != nil {
return fmt.Errorf("Wrong BlockPartsHeader: %v", err)
}
if m.BlockParts.Size() == 0 {
return errors.New("Empty BlockParts")
}
if m.BlockParts.Size() != m.BlockPartsHeader.Total {
return fmt.Errorf("BlockParts bit array size %d not equal to BlockPartsHeader.Total %d",
m.BlockParts.Size(),