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 ( import (
"context" "context"
"errors"
"strings" "strings"
"github.com/ethereum/go-ethereum/common" "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 { if err := rlp.DecodeBytes(encodedTx, tx); err != nil {
return common.Hash{}, err return common.Hash{}, err
} }
if tx.ChainID() != s.b.ChainConfig().ChainID { if tx.ChainID().Cmp(s.b.ChainConfig().ChainID) != 0 {
return common.Hash{}, ErrIncorrectChainID return common.Hash{}, errors.New("Incorrect chain ID. The current chain id: " + s.b.ChainConfig().ChainID.String())
} }
return SubmitTransaction(ctx, s.b, tx) return SubmitTransaction(ctx, s.b, tx)
} }

Loading…
Cancel
Save