Improved chain manager, improved block processor, fixed tests

* ChainManager allows cached future blocks for later processing
* BlockProcessor allows a 4 second window on future blocks
* Fixed tests
This commit is contained in:
obscuren
2015-04-04 16:35:23 +02:00
parent 29f120206e
commit e1ed8c33bd
4 changed files with 44 additions and 7 deletions

View File

@@ -109,6 +109,7 @@ func makeChain(bman *BlockProcessor, parent *types.Block, max int, db common.Dat
// Effectively a fork factory
func newChainManager(block *types.Block, eventMux *event.TypeMux, db common.Database) *ChainManager {
bc := &ChainManager{blockDb: db, stateDb: db, genesisBlock: GenesisBlock(db), eventMux: eventMux}
bc.futureBlocks = NewBlockCache(1000)
if block == nil {
bc.Reset()
} else {