diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-04-01 19:42:19 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-04-01 19:42:19 +0800 |
commit | c58079461bafe508bea9233e2b81852df5188f57 (patch) | |
tree | 33d4c6a96eed3bf1ce9f69bbef3cbc1561f2b114 /core/tx_pool.go | |
parent | 10d3466c934bd425a8c941270749a652a588527d (diff) | |
parent | 1f3596c25af077a3303c554ee6b49404b20f7117 (diff) | |
download | dexon-c58079461bafe508bea9233e2b81852df5188f57.tar dexon-c58079461bafe508bea9233e2b81852df5188f57.tar.gz dexon-c58079461bafe508bea9233e2b81852df5188f57.tar.bz2 dexon-c58079461bafe508bea9233e2b81852df5188f57.tar.lz dexon-c58079461bafe508bea9233e2b81852df5188f57.tar.xz dexon-c58079461bafe508bea9233e2b81852df5188f57.tar.zst dexon-c58079461bafe508bea9233e2b81852df5188f57.zip |
Merge pull request #2281 from obscuren/configurable-genesis
core: homestead chain configuration & artificial gas floor target mining flag
Diffstat (limited to 'core/tx_pool.go')
-rw-r--r-- | core/tx_pool.go | 7 |
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 } |