diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-03-02 06:32:43 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2016-04-01 07:01:10 +0800 |
commit | f0cbebb19f3137ee3ba0e66dadd1b5b9dbf98b1c (patch) | |
tree | 02e31a0e31040980e30e3a835ff9eba73e419439 /core/tx_pool.go | |
parent | 10d3466c934bd425a8c941270749a652a588527d (diff) | |
download | dexon-f0cbebb19f3137ee3ba0e66dadd1b5b9dbf98b1c.tar.gz dexon-f0cbebb19f3137ee3ba0e66dadd1b5b9dbf98b1c.tar.zst dexon-f0cbebb19f3137ee3ba0e66dadd1b5b9dbf98b1c.zip |
core: added basic chain configuration
Added chain configuration options and write out during genesis database
insertion. If no "config" was found, nothing is written to the database.
Configurations are written on a per genesis base. This means
that any chain (which is identified by it's genesis hash) can have their
own chain settings.
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 } |