Check feeAmount overflow in API

This commit is contained in:
ToniRamirezM
2020-11-05 12:15:47 +01:00
parent 9ab50135d7
commit f90f14d0c1
2 changed files with 16 additions and 2 deletions

View File

@@ -163,6 +163,11 @@ func verifyPoolL2TxWrite(txw *l2db.PoolL2TxWrite) error {
if err != nil {
return err
}
// Validate feeAmount
_, err = common.CalcFeeAmount(poolTx.Amount, poolTx.Fee)
if err != nil {
return err
}
// Check signature
if !poolTx.VerifySignature(account.PublicKey) {
return errors.New("wrong signature")