Merge pull request #1642 from mikedoan/chainid1

[transcationpool.go] fix bug on chain id and specify real chain id
pull/1647/head
Minh Doan 5 years ago committed by GitHub
commit fd870949ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      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)
}

Loading…
Cancel
Save