aboutsummaryrefslogtreecommitdiffstats
path: root/eth/api.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-03-02 21:06:16 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2017-03-02 21:06:16 +0800
commit9184249b393e4e332ae6a2f5d774880a88a9bfd6 (patch)
tree7788ce54cb04d1af4fe03ab3c2447354bcaac3cc /eth/api.go
parent82e7c1d1241737fd0ae9b25e0f20857b8597b148 (diff)
downloaddexon-9184249b393e4e332ae6a2f5d774880a88a9bfd6.tar.gz
dexon-9184249b393e4e332ae6a2f5d774880a88a9bfd6.tar.zst
dexon-9184249b393e4e332ae6a2f5d774880a88a9bfd6.zip
Logger updates 3 (#3730)
* accounts, cmd, eth, ethdb: port logs over to new system * ethdb: drop concept of cache distribution between dbs * eth: fix some log nitpicks to make them nicer
Diffstat (limited to 'eth/api.go')
-rw-r--r--eth/api.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/eth/api.go b/eth/api.go
index 3cec749df..3aac34ee0 100644
--- a/eth/api.go
+++ b/eth/api.go
@@ -37,7 +37,6 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/internal/ethapi"
- "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/miner"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rlp"
@@ -103,17 +102,17 @@ func (s *PublicMinerAPI) SubmitWork(nonce types.BlockNonce, solution, digest com
// result[0], 32 bytes hex encoded current block header pow-hash
// result[1], 32 bytes hex encoded seed hash used for DAG
// result[2], 32 bytes hex encoded boundary condition ("target"), 2^256/difficulty
-func (s *PublicMinerAPI) GetWork() (work [3]string, err error) {
+func (s *PublicMinerAPI) GetWork() ([3]string, error) {
if !s.e.IsMining() {
if err := s.e.StartMining(0); err != nil {
- return work, err
+ return [3]string{}, err
}
}
- if work, err = s.agent.GetWork(); err == nil {
- return
+ work, err := s.agent.GetWork()
+ if err != nil {
+ return work, fmt.Errorf("mining not ready: %v", err)
}
- log.Debug(fmt.Sprintf("%v", err))
- return work, fmt.Errorf("mining not ready")
+ return work, nil
}
// SubmitHashrate can be used for remote miners to submit their hash rate. This enables the node to report the combined