Removed ethereum as dependency

This commit is contained in:
obscuren 2014-12-18 12:18:19 +01:00
parent 4b2f1f7628
commit 590aace88d

View File

@ -58,8 +58,8 @@ type BlockManager struct {
mem map[string]*big.Int
// Proof of work used for validating
Pow pow.PoW
// The ethereum manager interface
eth EthManager
txpool *TxPool
// The last attempted block is mainly used for debugging purposes
// This does not have to be a valid block and will be set during
@ -71,13 +71,13 @@ type BlockManager struct {
eventMux *event.TypeMux
}
func NewBlockManager(ethereum EthManager) *BlockManager {
func NewBlockManager(txpool *TxPool, chainManager *ChainManager, eventMux *event.TypeMux) *BlockManager {
sm := &BlockManager{
mem: make(map[string]*big.Int),
Pow: ezp.New(),
eth: ethereum,
bc: ethereum.ChainManager(),
eventMux: ethereum.EventMux(),
bc: chainManager,
eventMux: eventMux,
txpool: txpool,
}
return sm
@ -240,7 +240,7 @@ func (sm *BlockManager) ProcessWithParent(block, parent *types.Block) (td *big.I
chainlogger.Infof("Processed block #%d (%x...)\n", block.Number, block.Hash()[0:4])
sm.eth.TxPool().RemoveSet(block.Transactions())
sm.txpool.RemoveSet(block.Transactions())
return td, messages, nil
} else {