Unverified Commit 3c776c71 authored by Martin Holst Swende's avatar Martin Holst Swende Committed by GitHub

retesteth: clean txpool on rewind, default dao support (#20596)

parent 24cab2d5
...@@ -355,7 +355,7 @@ func (api *RetestethAPI) SetChainParams(ctx context.Context, chainParams ChainPa ...@@ -355,7 +355,7 @@ func (api *RetestethAPI) SetChainParams(ctx context.Context, chainParams ChainPa
ChainID: chainId, ChainID: chainId,
HomesteadBlock: homesteadBlock, HomesteadBlock: homesteadBlock,
DAOForkBlock: daoForkBlock, DAOForkBlock: daoForkBlock,
DAOForkSupport: false, DAOForkSupport: true,
EIP150Block: eip150Block, EIP150Block: eip150Block,
EIP155Block: eip155Block, EIP155Block: eip155Block,
EIP158Block: eip158Block, EIP158Block: eip158Block,
...@@ -579,6 +579,9 @@ func (api *RetestethAPI) RewindToBlock(ctx context.Context, newHead uint64) (boo ...@@ -579,6 +579,9 @@ func (api *RetestethAPI) RewindToBlock(ctx context.Context, newHead uint64) (boo
if err := api.blockchain.SetHead(newHead); err != nil { if err := api.blockchain.SetHead(newHead); err != nil {
return false, err return false, err
} }
// When we rewind, the transaction pool should be cleaned out.
api.txMap = make(map[common.Address]map[uint64]*types.Transaction)
api.txSenders = make(map[common.Address]struct{})
return true, nil return true, nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment