Created
August 10, 2015 16:28
-
-
Save wanderer/7520ae8cd84397c6dc91 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Ethash = require('./') | |
const levelup = require('levelup') | |
const memdown = require('memdown') | |
Ethash.prototype.verifySubmit = function (number, headerHash, nonce, cb) { | |
var self = this | |
console.log(number); | |
this.loadEpoc(number, function () { | |
console.log("EPOC set"); | |
console.log(self.seed.toString('hex')); | |
var a = self.run(headerHash, new Buffer(nonce, 'hex')); | |
cb(a.hash); | |
}) | |
} | |
var cacheDB = levelup('', { | |
db: memdown | |
}) | |
var ethash = new Ethash(cacheDB); | |
var header = Buffer('0e2887aa1a0668bf8254d1a6ae518927de99e3e5d7f30fd1f16096e2608fe05e', 'hex'); | |
ethash.verifySubmit(35414, header, 'e360b6170c229d15', function (result) { | |
console.log(result.toString('hex')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment