Skip to content

Commit 54dac59

Browse files
committed
wip
1 parent a59bb05 commit 54dac59

4 files changed

Lines changed: 15 additions & 3 deletions

File tree

‎eth/backend.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ func New(config *Config) (*Ethereum, error) {
205205
ethProto := EthProtocol(config.ProtocolVersion, config.NetworkId, eth.txPool, eth.chainManager, eth.blockPool)
206206
protocols := []p2p.Protocol{ethProto}
207207
if config.Shh {
208-
protocols = append(protocols, eth.whisper.Protocol())
208+
//protocols = append(protocols, eth.whisper.Protocol())
209209
}
210210

211211
eth.net = &p2p.Server{

‎miner/agent.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,7 @@ func (self *CpuMiner) mine(block *types.Block) {
7979
self.returnCh <- Work{block.Number().Uint64(), nonce, mixDigest, seedHash}
8080
}
8181
}
82+
83+
func (self *CpuMiner) GetHashRate() int64 {
84+
return self.pow.GetHashrate()
85+
}

‎miner/worker.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ type Agent interface {
5757
SetWorkCh(chan<- Work)
5858
Stop()
5959
Start()
60-
Pow() pow.PoW
60+
GetHashRate() int64
6161
}
6262

6363
type worker struct {
@@ -272,7 +272,7 @@ func (self *worker) commitTransaction(tx *types.Transaction) error {
272272
func (self *worker) HashRate() int64 {
273273
var tot int64
274274
for _, agent := range self.agents {
275-
tot += agent.Pow().GetHashrate()
275+
tot += agent.GetHashRate()
276276
}
277277

278278
return tot

‎rpc/api.go‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,3 +488,11 @@ func toFilterOptions(options *BlockFilterArgs) *core.FilterOptions {
488488

489489
return &opts
490490
}
491+
492+
/*
493+
Work() chan<- *types.Block
494+
SetWorkCh(chan<- Work)
495+
Stop()
496+
Start()
497+
Rate() uint64
498+
*/

0 commit comments

Comments
 (0)