Skip to content

Commit e2b4962

Browse files
committed
Log transaction-chain mismatch
This commit adds a logging event that informs if a user tries to send a transaction with the wrong chain ID. Signed-off-by: Yacov Manevich <[email protected]>
1 parent d127ca9 commit e2b4962

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/txpool/legacypool/legacypool.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,9 @@ func (pool *LegacyPool) validateTxBasics(tx *types.Transaction, local bool) erro
683683
opts.MinTip = new(big.Int)
684684
}
685685
if err := txpool.ValidateTransaction(tx, pool.currentHead.Load(), pool.signer, opts); err != nil {
686+
if pool.chainconfig.ChainID.Cmp(tx.ChainId()) != 0 {
687+
log.Trace("Transaction targets wrong chain", "chainID", tx.ChainId(), "expected", pool.chainconfig.ChainID)
688+
}
686689
return err
687690
}
688691
return nil

0 commit comments

Comments
 (0)