diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-06-30 21:42:20 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-06-30 23:27:47 +0800 |
commit | a748afce0322af35d6031d76bf38afa1f974296a (patch) | |
tree | b36a2f2d97538fee560093558d4e6869afa353c4 /core/transaction_pool.go | |
parent | c14f0a44712891286b291761fb2d99bd90646234 (diff) | |
download | go-tangerine-a748afce0322af35d6031d76bf38afa1f974296a.tar.gz go-tangerine-a748afce0322af35d6031d76bf38afa1f974296a.tar.zst go-tangerine-a748afce0322af35d6031d76bf38afa1f974296a.zip |
core: txpool listen for ChainHeadEvent instead of ChainEvent
Changed the transaction pool to listen for ChainHeadEvent when resetting
the state instead of ChainEvent. It makes very little sense to burst
through transactions while we are catching up (e.g., have more than one
block to process)
Diffstat (limited to 'core/transaction_pool.go')
-rw-r--r-- | core/transaction_pool.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/transaction_pool.go b/core/transaction_pool.go index 6a7012c65..ac9027755 100644 --- a/core/transaction_pool.go +++ b/core/transaction_pool.go @@ -65,7 +65,7 @@ func NewTxPool(eventMux *event.TypeMux, currentStateFn stateFn, gasLimitFn func( gasLimit: gasLimitFn, minGasPrice: new(big.Int), pendingState: state.ManageState(currentStateFn()), - events: eventMux.Subscribe(ChainEvent{}, GasPriceChanged{}), + events: eventMux.Subscribe(ChainHeadEvent{}, GasPriceChanged{}), } go pool.eventLoop() @@ -80,7 +80,7 @@ func (pool *TxPool) eventLoop() { pool.mu.Lock() switch ev := ev.(type) { - case ChainEvent: + case ChainHeadEvent: pool.resetState() case GasPriceChanged: pool.minGasPrice = ev.Price |