Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check tx to_address 0x0 to avoid panic #247

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pool/pool_xlayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ func (p *Pool) checkFreeGp(ctx context.Context, poolTx Transaction, from common.
fromToName, freeGpList := GetSpecialFreeGasList(p.cfg.FreeGasList)
info := freeGpList[fromToName[from.String()]]
if info != nil &&
poolTx.To() != nil &&
Contains(info.ToList, *poolTx.To()) &&
ContainsMethod("0x"+common.Bytes2Hex(poolTx.Data()), info.MethodSigs) {
return true, nil
Expand Down
1 change: 1 addition & 0 deletions sequencer/sequencer_xlayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func (s *Sequencer) checkFreeGas(tx pool.Transaction, txTracker *TxTracker) (fre
fromToName, freeGpList := pool.GetSpecialFreeGasList(s.poolCfg.FreeGasList)
info := freeGpList[fromToName[txTracker.FromStr]]
if info != nil &&
tx.To() != nil &&
pool.Contains(info.ToList, *tx.To()) &&
pool.ContainsMethod("0x"+common.Bytes2Hex(tx.Data()), info.MethodSigs) {
gpMul = info.GasPriceMultiple
Expand Down
Loading