From de210f976db5659e83bdf3e71e885b67e244cf5e Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Tue, 13 Dec 2016 10:13:07 +0100 Subject: [PATCH] core: init pending state in tx pool on creation --- core/tx_pool.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/tx_pool.go b/core/tx_pool.go index b294b0e280ba..22577fccc8aa 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -100,6 +100,8 @@ func NewTxPool(config *ChainConfig, eventMux *event.TypeMux, currentStateFn stat quit: make(chan struct{}), } + pool.resetState() + pool.wg.Add(2) go pool.eventLoop() go pool.expirationLoop() @@ -348,10 +350,6 @@ func (pool *TxPool) enqueueTx(hash common.Hash, tx *types.Transaction) { // // Note, this method assumes the pool lock is held! func (pool *TxPool) promoteTx(addr common.Address, hash common.Hash, tx *types.Transaction) { - // Init delayed since tx pool could have been started before any state sync - if pool.pendingState == nil { - pool.resetState() - } // Try to insert the transaction into the pending queue if pool.pending[addr] == nil { pool.pending[addr] = newTxList(true)