diff --git a/abci/types/types.go b/abci/types/types.go index 904dd797d..5f620b2d5 100644 --- a/abci/types/types.go +++ b/abci/types/types.go @@ -261,6 +261,9 @@ func (rpp *ResponsePrepareProposal) Validate(maxSizeBytes int64, otxs [][]byte) for _, tr := range rpp.TxRecords { if tr.isIncluded() { size += int64(len(tr.Tx)) + if size > maxSizeBytes { + return fmt.Errorf("transaction data size %d exceeds maximum %d", size, maxSizeBytes) + } if _, ok := ntx[string(tr.Tx)]; ok { return errors.New("duplicate included transaction") } @@ -279,8 +282,5 @@ func (rpp *ResponsePrepareProposal) Validate(maxSizeBytes int64, otxs [][]byte) return fmt.Errorf("transaction incorrectly marked as %s", tr.Action.String()) } } - if size > maxSizeBytes { - return fmt.Errorf("transaction data size %d exceeds maximum %d", size, maxSizeBytes) - } return nil }