check chainID for incoming tx for rpc

pull/1617/head
Minh Doan 5 years ago
parent 564cd15704
commit 998e88c750
  1. 3
      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)
}

Loading…
Cancel
Save