diff options
author | gary rong <garyrong0905@gmail.com> | 2019-04-23 15:08:51 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-04-23 15:08:51 +0800 |
commit | 6269e5574c024bb82617b33f673550231b3a3b37 (patch) | |
tree | 2cacec84e759833f3e3e77174e65d1ca7b584e75 /miner/worker_test.go | |
parent | d9403690ecaf1beecc4369c56c4600caf275dae8 (diff) | |
download | go-tangerine-6269e5574c024bb82617b33f673550231b3a3b37.tar go-tangerine-6269e5574c024bb82617b33f673550231b3a3b37.tar.gz go-tangerine-6269e5574c024bb82617b33f673550231b3a3b37.tar.bz2 go-tangerine-6269e5574c024bb82617b33f673550231b3a3b37.tar.lz go-tangerine-6269e5574c024bb82617b33f673550231b3a3b37.tar.xz go-tangerine-6269e5574c024bb82617b33f673550231b3a3b37.tar.zst go-tangerine-6269e5574c024bb82617b33f673550231b3a3b37.zip |
miner: polish miner configuration (#19480)
* cmd, eth, miner: disable advance sealing if user require
* cmd, console, miner, les, eth: wrap the miner config
* eth: remove todo
* cmd, miner: revert noadvance flag
The reason for this is: if the transaction execution is even longer
than block time, then this kind of transactions is DoS attack.
Diffstat (limited to 'miner/worker_test.go')
-rw-r--r-- | miner/worker_test.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/miner/worker_test.go b/miner/worker_test.go index 99a671ae3..7fa9a5f98 100644 --- a/miner/worker_test.go +++ b/miner/worker_test.go @@ -52,6 +52,12 @@ var ( // Test transactions pendingTxs []*types.Transaction newTxs []*types.Transaction + + testConfig = &Config{ + Recommit: time.Second, + GasFloor: params.GenesisGasLimit, + GasCeil: params.GenesisGasLimit, + } ) func init() { @@ -134,7 +140,7 @@ func (b *testWorkerBackend) PostChainEvents(events []interface{}) { func newTestWorker(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine, blocks int) (*worker, *testWorkerBackend) { backend := newTestWorkerBackend(t, chainConfig, engine, blocks) backend.txPool.AddLocals(pendingTxs) - w := newWorker(chainConfig, engine, backend, new(event.TypeMux), time.Second, params.GenesisGasLimit, params.GenesisGasLimit, nil) + w := newWorker(testConfig, chainConfig, engine, backend, new(event.TypeMux), nil) w.setEtherbase(testBankAddress) return w, backend } |