From 592f21f5b97e5b1e714f194ae90ab83e6547cf41 Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 14 Aug 2019 01:37:25 -0400 Subject: finish a full chain example (with p2p network) --- miner/miner.go | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'miner') 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) } -- cgit v1.2.3-70-g09d2