mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 19:50:36 +00:00
checking txn chain id before adding it to the tx pool (#4855)
This commit is contained in:
parent
59bcbb4f33
commit
8b1574127a
@ -26,6 +26,13 @@ func (api *APIImpl) SendRawTransaction(ctx context.Context, encodedTx hexutil.By
|
||||
return common.Hash{}, err
|
||||
}
|
||||
|
||||
txnChainId := txn.GetChainID()
|
||||
chainId := api._chainConfig.ChainID
|
||||
|
||||
if chainId.Cmp(txnChainId.ToBig()) != 0 {
|
||||
return common.Hash{}, fmt.Errorf("invalid chain id, expected: %d got: %d", chainId, *txnChainId)
|
||||
}
|
||||
|
||||
// If the transaction fee cap is already specified, ensure the
|
||||
// fee of the given transaction is _reasonable_.
|
||||
if err := checkTxFee(txn.GetPrice().ToBig(), txn.GetGas(), ethconfig.Defaults.RPCTxFeeCap); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user