aboutsummaryrefslogtreecommitdiffstats
path: root/pow
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-23 20:48:44 +0800
committerobscuren <geffobscura@gmail.com>2014-12-23 20:48:44 +0800
commit4cd79d8ddd7608d60344b13fe4bda7315429d1d9 (patch)
tree0d1abaa9ef5c302c1ef51e8e8dbd94e9e696f28a /pow
parent4b52cd512d3c54451e680fcc6c3d67d059065bec (diff)
downloadgo-tangerine-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar
go-tangerine-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar.gz
go-tangerine-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar.bz2
go-tangerine-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar.lz
go-tangerine-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar.xz
go-tangerine-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar.zst
go-tangerine-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.zip
Refactored block & Transaction
* Includes new rlp decoder
Diffstat (limited to 'pow')
-rw-r--r--pow/block.go2
-rw-r--r--pow/ezp/pow.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/pow/block.go b/pow/block.go
index 4759e19fb..62df2b5ff 100644
--- a/pow/block.go
+++ b/pow/block.go
@@ -3,7 +3,7 @@ package pow
import "math/big"
type Block interface {
- Diff() *big.Int
+ Difficulty() *big.Int
HashNoNonce() []byte
N() []byte
}
diff --git a/pow/ezp/pow.go b/pow/ezp/pow.go
index f669f8aa4..f9f27326f 100644
--- a/pow/ezp/pow.go
+++ b/pow/ezp/pow.go
@@ -35,7 +35,7 @@ func (pow *EasyPow) Turbo(on bool) {
func (pow *EasyPow) Search(block pow.Block, stop <-chan struct{}) []byte {
r := rand.New(rand.NewSource(time.Now().UnixNano()))
hash := block.HashNoNonce()
- diff := block.Diff()
+ diff := block.Difficulty()
i := int64(0)
start := time.Now().UnixNano()
t := time.Now()
@@ -89,5 +89,5 @@ func verify(hash []byte, diff *big.Int, nonce []byte) bool {
}
func Verify(block pow.Block) bool {
- return verify(block.HashNoNonce(), block.Diff(), block.N())
+ return verify(block.HashNoNonce(), block.Difficulty(), block.N())
}