From 9626c10c491cd15c9e489a7335a6adf978b7e1cd Mon Sep 17 00:00:00 2001 From: Minh Doan Date: Mon, 23 Sep 2019 11:15:10 -0700 Subject: [PATCH] fix bug on chain id and specify real chain id --- internal/hmyapi/transactionpool.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/hmyapi/transactionpool.go b/internal/hmyapi/transactionpool.go index db1520d27..25ceee573 100644 --- a/internal/hmyapi/transactionpool.go +++ b/internal/hmyapi/transactionpool.go @@ -2,6 +2,7 @@ package hmyapi import ( "context" + "errors" "strings" "github.com/ethereum/go-ethereum/common" @@ -161,8 +162,8 @@ 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 + if tx.ChainID().Cmp(s.b.ChainConfig().ChainID) != 0 { + return common.Hash{}, errors.New("Incorrect chain ID. The current chain id: " + s.b.ChainConfig().ChainID.String()) } return SubmitTransaction(ctx, s.b, tx) }