diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-25 21:57:49 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-25 21:58:12 +0800 |
commit | ff5578fc715262cd8ae62e7d0f961a6e977a8727 (patch) | |
tree | 41e4ae3d9e2ebda853bf68f0746dfbc35a534c40 /Godeps/_workspace/src/github.com/ethereum/ethash/ethash.go | |
parent | a2e3bf6f3002e9914f56e08b1d6e323409ff3b4f (diff) | |
download | go-tangerine-ff5578fc715262cd8ae62e7d0f961a6e977a8727.tar go-tangerine-ff5578fc715262cd8ae62e7d0f961a6e977a8727.tar.gz go-tangerine-ff5578fc715262cd8ae62e7d0f961a6e977a8727.tar.bz2 go-tangerine-ff5578fc715262cd8ae62e7d0f961a6e977a8727.tar.lz go-tangerine-ff5578fc715262cd8ae62e7d0f961a6e977a8727.tar.xz go-tangerine-ff5578fc715262cd8ae62e7d0f961a6e977a8727.tar.zst go-tangerine-ff5578fc715262cd8ae62e7d0f961a6e977a8727.zip |
updated ethash
Diffstat (limited to 'Godeps/_workspace/src/github.com/ethereum/ethash/ethash.go')
-rw-r--r-- | Godeps/_workspace/src/github.com/ethereum/ethash/ethash.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Godeps/_workspace/src/github.com/ethereum/ethash/ethash.go b/Godeps/_workspace/src/github.com/ethereum/ethash/ethash.go index 3c24fd239..8746aaca9 100644 --- a/Godeps/_workspace/src/github.com/ethereum/ethash/ethash.go +++ b/Godeps/_workspace/src/github.com/ethereum/ethash/ethash.go @@ -85,7 +85,7 @@ func makeParamsAndCache(chainManager pow.ChainManager, blockNum uint64) (*Params Epoch: blockNum / epochLength, } C.ethash_params_init(paramsAndCache.params, C.uint32_t(uint32(blockNum))) - paramsAndCache.cache.mem = C.malloc(C.size_t(paramsAndCache.params.cache_size)) + paramsAndCache.cache.mem = C.malloc(paramsAndCache.params.cache_size) seedHash, err := GetSeedHash(blockNum) if err != nil { @@ -118,7 +118,7 @@ func (pow *Ethash) UpdateCache(force bool) error { func makeDAG(p *ParamsAndCache) *DAG { d := &DAG{ - dag: C.malloc(C.size_t(p.params.full_size)), + dag: C.malloc(p.params.full_size), file: false, paramsAndCache: p, } @@ -360,10 +360,11 @@ func (pow *Ethash) Search(block pow.Block, stop <-chan struct{}) (uint64, []byte } func (pow *Ethash) Verify(block pow.Block) bool { - return pow.verify(block.HashNoNonce().Bytes(), block.MixDigest().Bytes(), block.Difficulty(), block.NumberU64(), block.Nonce()) + + return pow.verify(block.HashNoNonce(), block.MixDigest(), block.Difficulty(), block.NumberU64(), block.Nonce()) } -func (pow *Ethash) verify(hash []byte, mixDigest []byte, difficulty *big.Int, blockNum uint64, nonce uint64) bool { +func (pow *Ethash) verify(hash common.Hash, mixDigest common.Hash, difficulty *big.Int, blockNum uint64, nonce uint64) bool { // Make sure the block num is valid if blockNum >= epochLength*2048 { powlogger.Infoln(fmt.Sprintf("Block number exceeds limit, invalid (value is %v, limit is %v)", |