Skip to content

Commit b9adeeb

Browse files
authored
Merge pull request #40 from bas-vk/quorum-txpool-pending-state
core: init pending state in tx pool on creation
2 parents f5e8664 + de210f9 commit b9adeeb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

core/tx_pool.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ func NewTxPool(config *ChainConfig, eventMux *event.TypeMux, currentStateFn stat
100100
quit: make(chan struct{}),
101101
}
102102

103+
pool.resetState()
104+
103105
pool.wg.Add(2)
104106
go pool.eventLoop()
105107
go pool.expirationLoop()
@@ -348,10 +350,6 @@ func (pool *TxPool) enqueueTx(hash common.Hash, tx *types.Transaction) {
348350
//
349351
// Note, this method assumes the pool lock is held!
350352
func (pool *TxPool) promoteTx(addr common.Address, hash common.Hash, tx *types.Transaction) {
351-
// Init delayed since tx pool could have been started before any state sync
352-
if pool.pendingState == nil {
353-
pool.resetState()
354-
}
355353
// Try to insert the transaction into the pending queue
356354
if pool.pending[addr] == nil {
357355
pool.pending[addr] = newTxList(true)

0 commit comments

Comments
 (0)