aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-21 00:42:09 +0800
committerobscuren <geffobscura@gmail.com>2015-03-21 00:42:09 +0800
commit54dac59285ccc6a3af47201479ca556da2899e93 (patch)
tree8f753059c4f1799046fa10a861884944a5f453fc
parenta59bb053f4d2a4a28341c645c051c4c323581a1b (diff)
downloadgo-tangerine-54dac59285ccc6a3af47201479ca556da2899e93.tar.gz
go-tangerine-54dac59285ccc6a3af47201479ca556da2899e93.tar.zst
go-tangerine-54dac59285ccc6a3af47201479ca556da2899e93.zip
wip
-rw-r--r--eth/backend.go2
-rw-r--r--miner/agent.go4
-rw-r--r--miner/worker.go4
-rw-r--r--rpc/api.go8
4 files changed, 15 insertions, 3 deletions
diff --git a/eth/backend.go b/eth/backend.go
index afe314d74..52f336c1d 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -205,7 +205,7 @@ func New(config *Config) (*Ethereum, error) {
ethProto := EthProtocol(config.ProtocolVersion, config.NetworkId, eth.txPool, eth.chainManager, eth.blockPool)
protocols := []p2p.Protocol{ethProto}
if config.Shh {
- protocols = append(protocols, eth.whisper.Protocol())
+ //protocols = append(protocols, eth.whisper.Protocol())
}
eth.net = &p2p.Server{
diff --git a/miner/agent.go b/miner/agent.go
index 6865d5a08..64491e04c 100644
--- a/miner/agent.go
+++ b/miner/agent.go
@@ -79,3 +79,7 @@ func (self *CpuMiner) mine(block *types.Block) {
self.returnCh <- Work{block.Number().Uint64(), nonce, mixDigest, seedHash}
}
}
+
+func (self *CpuMiner) GetHashRate() int64 {
+ return self.pow.GetHashrate()
+}
diff --git a/miner/worker.go b/miner/worker.go
index 63d1bfa0b..ae6782aca 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -57,7 +57,7 @@ type Agent interface {
SetWorkCh(chan<- Work)
Stop()
Start()
- Pow() pow.PoW
+ GetHashRate() int64
}
type worker struct {
@@ -272,7 +272,7 @@ func (self *worker) commitTransaction(tx *types.Transaction) error {
func (self *worker) HashRate() int64 {
var tot int64
for _, agent := range self.agents {
- tot += agent.Pow().GetHashrate()
+ tot += agent.GetHashRate()
}
return tot
diff --git a/rpc/api.go b/rpc/api.go
index 659bc373d..34d4ff0fc 100644
--- a/rpc/api.go
+++ b/rpc/api.go
@@ -488,3 +488,11 @@ func toFilterOptions(options *BlockFilterArgs) *core.FilterOptions {
return &opts
}
+
+/*
+ Work() chan<- *types.Block
+ SetWorkCh(chan<- Work)
+ Stop()
+ Start()
+ Rate() uint64
+*/