[NOD-272] In CheckTransactionSanity, multiply mass limit check by massPerTxByte. (#365)

This commit is contained in:
stasatdaglabs 2019-08-15 15:05:26 +03:00 committed by Svarog
parent 187c525667
commit 534cb2bf5b

View File

@ -129,7 +129,7 @@ func CheckTransactionSanity(tx *util.Tx, subnetworkID *subnetworkid.SubnetworkID
// A transaction must not exceed the maximum allowed block mass when // A transaction must not exceed the maximum allowed block mass when
// serialized. // serialized.
serializedTxSize := msgTx.SerializeSize() serializedTxSize := msgTx.SerializeSize()
if serializedTxSize > wire.MaxMassPerBlock { if serializedTxSize*massPerTxByte > wire.MaxMassPerBlock {
str := fmt.Sprintf("serialized transaction is too big - got "+ str := fmt.Sprintf("serialized transaction is too big - got "+
"%d, max %d", serializedTxSize, wire.MaxMassPerBlock) "%d, max %d", serializedTxSize, wire.MaxMassPerBlock)
return ruleError(ErrTxMassTooHigh, str) return ruleError(ErrTxMassTooHigh, str)