tests for tx size limit (32 KB)

This commit is contained in:
Michael Riabzev 2019-10-28 18:44:42 +02:00 committed by Péter Szilágyi
parent de111ef4b7
commit 1d96ea8116
No known key found for this signature in database
GPG key ID: E9AE538CEDF8293D

View file

@ -271,6 +271,9 @@ func NewTxPool(config TxPoolConfig, chainconfig *params.ChainConfig, chain block
reorgDoneCh: make(chan chan struct{}), reorgDoneCh: make(chan chan struct{}),
reorgShutdownCh: make(chan struct{}), reorgShutdownCh: make(chan struct{}),
gasPrice: new(big.Int).SetUint64(config.PriceLimit), gasPrice: new(big.Int).SetUint64(config.PriceLimit),
// Heuristic limit, reject transactions over 32KB to prevent DOS attacks
maxTxSize: 32 * 1024,
} }
pool.locals = newAccountSet(pool.signer) pool.locals = newAccountSet(pool.signer)
for _, addr := range config.Locals { for _, addr := range config.Locals {