aboutsummaryrefslogtreecommitdiffstats
path: root/core/tx_pool.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/tx_pool.go')
-rw-r--r--core/tx_pool.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/tx_pool.go b/core/tx_pool.go
index f4e964bf7..e997e8cd0 100644
--- a/core/tx_pool.go
+++ b/core/tx_pool.go
@@ -30,7 +30,6 @@ import (
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
- "github.com/ethereum/go-ethereum/params"
)
var (
@@ -60,6 +59,7 @@ type stateFn func() (*state.StateDB, error)
// current state) and future transactions. Transactions move between those
// two states over time as they are received and processed.
type TxPool struct {
+ config *ChainConfig
quit chan bool // Quitting channel
currentState stateFn // The state function which will allow us to do some pre checks
pendingState *state.ManagedState
@@ -75,8 +75,9 @@ type TxPool struct {
homestead bool
}
-func NewTxPool(eventMux *event.TypeMux, currentStateFn stateFn, gasLimitFn func() *big.Int) *TxPool {
+func NewTxPool(config *ChainConfig, eventMux *event.TypeMux, currentStateFn stateFn, gasLimitFn func() *big.Int) *TxPool {
pool := &TxPool{
+ config: config,
pending: make(map[common.Hash]*types.Transaction),
queue: make(map[common.Address]map[common.Hash]*types.Transaction),
quit: make(chan bool),
@@ -102,7 +103,7 @@ func (pool *TxPool) eventLoop() {
switch ev := ev.Data.(type) {
case ChainHeadEvent:
pool.mu.Lock()
- if ev.Block != nil && params.IsHomestead(ev.Block.Number()) {
+ if ev.Block != nil && pool.config.IsHomestead(ev.Block.Number()) {
pool.homestead = true
}