diff --git a/src_common/ethUstream.c b/src_common/ethUstream.c index 517691e..5d404fe 100644 --- a/src_common/ethUstream.c +++ b/src_common/ethUstream.c @@ -264,7 +264,7 @@ static parserStatus_e processTxInternal(txContext_t *context) { return USTREAM_PROCESSING; } // EIP 2718: TransactionType might be present before the TransactionPayload. - if (*context->workBuffer > 0x00 && *context->workBuffer < 0x7f) { + if (*context->workBuffer >= MIN_TX_TYPE && *context->workBuffer <= MAX_TX_TYPE) { uint8_t maybeType = *context->workBuffer; PRINTF("TX TYPE: %u\n", maybeType); diff --git a/src_common/ethUstream.h b/src_common/ethUstream.h index 1b9bf2e..05921bb 100644 --- a/src_common/ethUstream.h +++ b/src_common/ethUstream.h @@ -53,6 +53,9 @@ typedef enum rlpTxField_e { TX_RLP_DONE } rlpTxField_e; +#define MIN_TX_TYPE 0x00 +#define MAX_TX_TYPE 0x7f + // EIP 2718 TransactionType typedef enum txType_e { LEGACY_TX,