From 998e88c7503a504998862a6d1a6a6e1e632edda2 Mon Sep 17 00:00:00 2001 From: Minh Doan Date: Wed, 18 Sep 2019 12:01:19 -0700 Subject: [PATCH] check chainID for incoming tx for rpc --- internal/hmyapi/transactionpool.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/hmyapi/transactionpool.go b/internal/hmyapi/transactionpool.go index 0408f6403..bddb6ad1d 100644 --- a/internal/hmyapi/transactionpool.go +++ b/internal/hmyapi/transactionpool.go @@ -131,6 +131,9 @@ func (s *PublicTransactionPoolAPI) SendRawTransaction(ctx context.Context, encod if err := rlp.DecodeBytes(encodedTx, tx); err != nil { return common.Hash{}, err } + if tx.ChainID() != s.b.ChainConfig().ChainID { + return common.Hash{}, ErrIncorrectChainID + } return SubmitTransaction(ctx, s.b, tx) }