diff options
author | Determinant <[email protected]> | 2019-08-14 01:37:25 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2019-08-14 01:37:25 -0400 |
commit | 592f21f5b97e5b1e714f194ae90ab83e6547cf41 (patch) | |
tree | c500cdf4ca4266af15703eca182df34d66715918 /miner | |
parent | ad886faec521f1edcb90f6f8eb4555608d085312 (diff) |
finish a full chain example (with p2p network)
Diffstat (limited to 'miner')
-rw-r--r-- | miner/miner.go | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/miner/miner.go b/miner/miner.go index 56440cd..969dceb 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -50,9 +50,6 @@ func New(eth Backend, config *Config, chainConfig *params.ChainConfig, mux *even } } -func (self *Miner) SetEtherbase(addr common.Address) { - self.w.setEtherbase(addr) -} func (self *Miner) Start(coinbase common.Address) { self.w.start() @@ -62,6 +59,14 @@ func (self *Miner) Stop() { self.w.stop() } +func (self *Miner) Mining() bool { + return false +} + +func (self *Miner) HashRate() uint64 { + return 0 +} + func (self *Miner) SetExtra(extra []byte) error { if uint64(len(extra)) > params.MaximumExtraDataSize { return fmt.Errorf("Extra exceeds max length. %d > %v", len(extra), params.MaximumExtraDataSize) @@ -70,20 +75,19 @@ func (self *Miner) SetExtra(extra []byte) error { return nil } -func (self *Miner) Mining() bool { - return false +func (self *Miner) SetRecommitInterval(interval time.Duration) { + self.w.setRecommitInterval(interval) } -func (self *Miner) HashRate() uint64 { - return 0 +func (self *Miner) Pending() (*types.Block, *state.StateDB) { + return self.w.pending() } -func (self *Miner) SetRecommitInterval(interval time.Duration) {} func (self *Miner) PendingBlock() *types.Block { return self.w.pendingBlock() } -func (self *Miner) Pending() (*types.Block, *state.StateDB) { - return self.w.pending() +func (self *Miner) SetEtherbase(addr common.Address) { + self.w.setEtherbase(addr) } |