aboutsummaryrefslogtreecommitdiffstats
path: root/core/chain_makers.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-09 02:47:32 +0800
committerobscuren <geffobscura@gmail.com>2015-04-09 02:47:32 +0800
commit6184781b49242b8029522612ad94cd45b508abc1 (patch)
tree4e8822e2000a885018e712b9cefb2a2ac3a512ca /core/chain_makers.go
parenta7750c929b926d164195fd4f7a7e2b4642c66173 (diff)
downloadgo-tangerine-6184781b49242b8029522612ad94cd45b508abc1.tar.gz
go-tangerine-6184781b49242b8029522612ad94cd45b508abc1.tar.zst
go-tangerine-6184781b49242b8029522612ad94cd45b508abc1.zip
Improved transaction pool
The transaction pool will now some easily be able to pre determine the validity of a transaction by checking the following: * Account existst * gas limit higher than the instrinsic gas * enough funds to pay upfront costs * nonce check
Diffstat (limited to 'core/chain_makers.go')
-rw-r--r--core/chain_makers.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/core/chain_makers.go b/core/chain_makers.go
index bbf1b1439..810741820 100644
--- a/core/chain_makers.go
+++ b/core/chain_makers.go
@@ -45,8 +45,8 @@ func NewChainMan(block *types.Block, eventMux *event.TypeMux, db common.Database
return newChainManager(block, eventMux, db)
}
-func NewBlockProc(db common.Database, txpool *TxPool, cman *ChainManager, eventMux *event.TypeMux) *BlockProcessor {
- return newBlockProcessor(db, txpool, cman, eventMux)
+func NewBlockProc(db common.Database, cman *ChainManager, eventMux *event.TypeMux) *BlockProcessor {
+ return newBlockProcessor(db, cman, eventMux)
}
func NewCanonical(n int, db common.Database) (*BlockProcessor, error) {
@@ -120,8 +120,10 @@ func newChainManager(block *types.Block, eventMux *event.TypeMux, db common.Data
}
// block processor with fake pow
-func newBlockProcessor(db common.Database, txpool *TxPool, cman *ChainManager, eventMux *event.TypeMux) *BlockProcessor {
- bman := NewBlockProcessor(db, db, FakePow{}, txpool, newChainManager(nil, eventMux, db), eventMux)
+func newBlockProcessor(db common.Database, cman *ChainManager, eventMux *event.TypeMux) *BlockProcessor {
+ chainMan := newChainManager(nil, eventMux, db)
+ txpool := NewTxPool(eventMux, chainMan.State)
+ bman := NewBlockProcessor(db, db, FakePow{}, txpool, chainMan, eventMux)
return bman
}
@@ -129,9 +131,8 @@ func newBlockProcessor(db common.Database, txpool *TxPool, cman *ChainManager, e
// on result of makeChain
func newCanonical(n int, db common.Database) (*BlockProcessor, error) {
eventMux := &event.TypeMux{}
- txpool := NewTxPool(eventMux)
- bman := newBlockProcessor(db, txpool, newChainManager(nil, eventMux, db), eventMux)
+ bman := newBlockProcessor(db, newChainManager(nil, eventMux, db), eventMux)
bman.bc.SetProcessor(bman)
parent := bman.bc.CurrentBlock()
if n == 0 {