Initial smart-miner stuff

This commit is contained in:
Maran
2014-03-10 11:53:02 +01:00
parent be543a6d17
commit d5efeab8f9
5 changed files with 47 additions and 9 deletions

View File

@ -60,6 +60,8 @@ type Ethereum struct {
// Specifies the desired amount of maximum peers
MaxPeers int
reactor *ethutil.ReactorEngine
}
func New(caps Caps, usePnp bool) (*Ethereum, error) {
@ -89,6 +91,8 @@ func New(caps Caps, usePnp bool) (*Ethereum, error) {
serverCaps: caps,
nat: nat,
}
ethereum.reactor = ethutil.NewReactorEngine()
ethereum.txPool = ethchain.NewTxPool(ethereum)
ethereum.blockChain = ethchain.NewBlockChain(ethereum)
ethereum.stateManager = ethchain.NewStateManager(ethereum)
@ -99,6 +103,10 @@ func New(caps Caps, usePnp bool) (*Ethereum, error) {
return ethereum, nil
}
func (s *Ethereum) Reactor() *ethutil.ReactorEngine {
return s.reactor
}
func (s *Ethereum) BlockChain() *ethchain.BlockChain {
return s.blockChain
}