aboutsummaryrefslogtreecommitdiffstats
path: root/Godeps
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2015-03-16 23:46:29 +0800
committerzelig <viktor.tron@gmail.com>2015-03-16 23:46:29 +0800
commit5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb (patch)
treed5ba6197a8c0c8e36bb92ee9fc8aad717cb2d178 /Godeps
parent8393dab470c40678caf36ada82e312d29c4cf5c4 (diff)
parent22893b7ac925c49168c119f293ea8befc3aff5cc (diff)
downloaddexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar
dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar.gz
dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar.bz2
dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar.lz
dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar.xz
dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.tar.zst
dexon-5e7702fd050ed5520a03cc2cfc8b1f45a70f35fb.zip
Merge remote-tracking branch 'upstream/develop' into frontier/js
Conflicts: cmd/ethereum/js.go javascript/types.go
Diffstat (limited to 'Godeps')
-rw-r--r--Godeps/Godeps.json4
-rw-r--r--Godeps/_workspace/src/github.com/ethereum/ethash/ethash.go12
2 files changed, 9 insertions, 7 deletions
diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json
index 988c21d4f..e6eab504d 100644
--- a/Godeps/Godeps.json
+++ b/Godeps/Godeps.json
@@ -22,8 +22,8 @@
},
{
"ImportPath": "github.com/ethereum/ethash",
- "Comment": "v23-11-g5376ec8",
- "Rev": "5376ec8816d6bf787d4fc91a08b4527bc5e1f469"
+ "Comment": "v23-12-g149261a",
+ "Rev": "149261a5d7cafc3943cbcf1d370082ec70d81e8b"
},
{
"ImportPath": "github.com/ethereum/serpent-go",
diff --git a/Godeps/_workspace/src/github.com/ethereum/ethash/ethash.go b/Godeps/_workspace/src/github.com/ethereum/ethash/ethash.go
index 6f1302bb8..7328bc922 100644
--- a/Godeps/_workspace/src/github.com/ethereum/ethash/ethash.go
+++ b/Godeps/_workspace/src/github.com/ethereum/ethash/ethash.go
@@ -32,7 +32,7 @@ import (
"unsafe"
"github.com/ethereum/go-ethereum/crypto"
- "github.com/ethereum/go-ethereum/ethutil"
+ "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/pow"
)
@@ -102,7 +102,9 @@ func makeParamsAndCache(chainManager pow.ChainManager, blockNum uint64) (*Params
func (pow *Ethash) UpdateCache(force bool) error {
pow.cacheMutex.Lock()
- thisEpoch := pow.chainManager.CurrentBlock().NumberU64()
+ defer pow.cacheMutex.Unlock()
+
+ thisEpoch := pow.chainManager.CurrentBlock().NumberU64() / epochLength
if force || pow.paramsAndCache.Epoch != thisEpoch {
var err error
pow.paramsAndCache, err = makeParamsAndCache(pow.chainManager, pow.chainManager.CurrentBlock().NumberU64())
@@ -110,7 +112,7 @@ func (pow *Ethash) UpdateCache(force bool) error {
panic(err)
}
}
- pow.cacheMutex.Unlock()
+
return nil
}
@@ -335,7 +337,7 @@ func (pow *Ethash) Search(block pow.Block, stop <-chan struct{}) (uint64, []byte
pow.HashRate = int64(hashes)
C.ethash_full(&ret, pow.dag.dag, pow.dag.paramsAndCache.params, cMiningHash, C.uint64_t(nonce))
- result := ethutil.Bytes2Big(C.GoBytes(unsafe.Pointer(&ret.result[0]), C.int(32)))
+ result := common.Bytes2Big(C.GoBytes(unsafe.Pointer(&ret.result[0]), C.int(32)))
// TODO: disagrees with the spec https://github.com/ethereum/wiki/wiki/Ethash#mining
if result.Cmp(target) <= 0 {
@@ -400,7 +402,7 @@ func (pow *Ethash) verify(hash []byte, mixDigest []byte, difficulty *big.Int, bl
C.ethash_light(ret, pAc.cache, pAc.params, chash, cnonce)
- result := ethutil.Bytes2Big(C.GoBytes(unsafe.Pointer(&ret.result[0]), C.int(32)))
+ result := common.Bytes2Big(C.GoBytes(unsafe.Pointer(&ret.result[0]), C.int(32)))
return result.Cmp(target) <= 0
}