From 1d96ea81163cfdf822d21770b06595ab4eee5500 Mon Sep 17 00:00:00 2001 From: Michael Riabzev Date: Mon, 28 Oct 2019 18:44:42 +0200 Subject: [PATCH] tests for tx size limit (32 KB) --- core/tx_pool.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/tx_pool.go b/core/tx_pool.go index d148559984..8d4bc97279 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -271,6 +271,9 @@ func NewTxPool(config TxPoolConfig, chainconfig *params.ChainConfig, chain block reorgDoneCh: make(chan chan struct{}), reorgShutdownCh: make(chan struct{}), 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) for _, addr := range config.Locals {