Skip to content

Commit

Permalink
Merge pull request ethereum#40 from bas-vk/quorum-txpool-pending-state
Browse files Browse the repository at this point in the history
core: init pending state in tx pool on creation
  • Loading branch information
jpmsam authored Jan 17, 2017
2 parents f5e8664 + de210f9 commit b9adeeb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/tx_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b9adeeb

Please sign in to comment.