aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-23 18:21:41 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-23 18:21:41 +0800
commit91a2275ad359b2f72565b926dac7dcd77b14a241 (patch)
tree7ba7643d0efcfe6d865651552f0ce994b07ffd20
parent439481d177aa6d19ef0254e4e4e0d5a39a8ff09a (diff)
downloadgo-tangerine-91a2275ad359b2f72565b926dac7dcd77b14a241.tar.gz
go-tangerine-91a2275ad359b2f72565b926dac7dcd77b14a241.tar.zst
go-tangerine-91a2275ad359b2f72565b926dac7dcd77b14a241.zip
Move RemoteAgent to miner pkg
-rw-r--r--miner/remote_agent.go (renamed from xeth/miner_agent.go)9
-rw-r--r--xeth/xeth.go6
2 files changed, 7 insertions, 8 deletions
diff --git a/xeth/miner_agent.go b/miner/remote_agent.go
index b00439ed4..8ea164f34 100644
--- a/xeth/miner_agent.go
+++ b/miner/remote_agent.go
@@ -1,10 +1,9 @@
-package xeth
+package miner
import (
"github.com/ethereum/ethash"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
- "github.com/ethereum/go-ethereum/miner"
)
type RemoteAgent struct {
@@ -13,7 +12,7 @@ type RemoteAgent struct {
quit chan struct{}
workCh chan *types.Block
- returnCh chan<- miner.Work
+ returnCh chan<- Work
}
func NewRemoteAgent() *RemoteAgent {
@@ -27,7 +26,7 @@ func (a *RemoteAgent) Work() chan<- *types.Block {
return a.workCh
}
-func (a *RemoteAgent) SetWorkCh(returnCh chan<- miner.Work) {
+func (a *RemoteAgent) SetWorkCh(returnCh chan<- Work) {
a.returnCh = returnCh
}
@@ -74,7 +73,7 @@ func (a *RemoteAgent) SubmitWork(nonce uint64, mixDigest, seedHash common.Hash)
// Make sure the external miner was working on the right hash
if a.currentWork != nil && a.work != nil && a.currentWork.Hash() == a.work.Hash() {
- a.returnCh <- miner.Work{a.currentWork.Number().Uint64(), nonce, mixDigest.Bytes(), seedHash.Bytes()}
+ a.returnCh <- Work{a.currentWork.Number().Uint64(), nonce, mixDigest.Bytes(), seedHash.Bytes()}
return true
}
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 5faeeb766..23e523980 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -102,7 +102,7 @@ type XEth struct {
// register map[string][]*interface{} // TODO improve return type
// Miner agent
- agent *RemoteAgent
+ agent *miner.RemoteAgent
}
// New creates an XEth that uses the given frontend.
@@ -120,7 +120,7 @@ func New(eth Backend, frontend Frontend) *XEth {
frontend: frontend,
logs: make(map[int]*logFilter),
messages: make(map[int]*whisperFilter),
- agent: NewRemoteAgent(),
+ agent: miner.NewRemoteAgent(),
}
eth.Miner().Register(xeth.agent)
@@ -170,7 +170,7 @@ func (self *XEth) stop() {
func (self *XEth) DefaultGas() *big.Int { return defaultGas }
func (self *XEth) DefaultGasPrice() *big.Int { return defaultGasPrice }
-func (self *XEth) RemoteMining() *RemoteAgent { return self.agent }
+func (self *XEth) RemoteMining() *miner.RemoteAgent { return self.agent }
func (self *XEth) AtStateNum(num int64) *XEth {
chain := self.Backend().ChainManager()