Skip to content

Commit

Permalink
bug fix - validateTxType
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbitprincess committed Oct 18, 2023
1 parent 3099fdf commit cc80e3a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions contract/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,13 @@ func validateTxType(txType types.TxType, amount *big.Int, payloadSize int, versi
// starting from hardfork version 3, transactions expected to CALL a
// contract but without a valid recipient will emit an error.
// FEEDELEGATION txns with invalid recipient are rejected on mempool.
if version >= 3 && txType == types.TxType_CALL {
// continue now and emit an error below for correct gas estimation
} else {
if !(version >= 3 && txType == types.TxType_CALL) {
// Here, the condition for fee delegation TX essentially being
// call-type, is not necessary, because it is rejected from the
// mempool without code hash.
return false, nil
}
// continue now and emit an error below for correct gas estimation
}
return true, nil
}
Expand Down

0 comments on commit cc80e3a

Please sign in to comment.