Compare commits

...

4 Commits

Author SHA1 Message Date
MoneroOcean 80b9b2be12 Eth draft support 2021-01-22 21:14:28 +00:00
MoneroOcean d405a871a4 Eth draft support 2021-01-22 21:07:24 +00:00
MoneroOcean de78291246 Eth draft support 2021-01-22 08:42:47 +00:00
MoneroOcean 04ba92e6fd Eth draft support 2021-01-22 08:38:27 +00:00
2 changed files with 10 additions and 9 deletions
+9 -8
View File
@@ -55,12 +55,12 @@ function getMerkleRoot(transactions) {
let last_epoch_number;
let last_seed_hash;
module.exports.baseRavenDiff = function() {
return parseInt('0x00000000ff000000000000000000000000000000000000000000000000000000');
module.exports.baseDiff = function() {
return bignum('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF', 16);
};
module.exports.baseEthDiff = function() {
return parseInt('0x00000000ffff0000000000000000000000000000000000000000000000000000');
module.exports.baseRavenDiff = function() {
return parseInt('0x00000000ff000000000000000000000000000000000000000000000000000000');
};
module.exports.RavenBlockTemplate = function(rpcData, poolAddress) {
@@ -182,10 +182,11 @@ module.exports.constructNewDeroBlob = function(blockTemplate, nonceBuff) {
};
module.exports.EthBlockTemplate = function(rpcData) {
const difficulty = parseFloat((module.exports.baseEth() / bignum(rpcData[2].lstrip("0x"), 16).toNumber()).toFixed(19));
const difficulty = module.exports.baseDiff().div(bignum(rpcData[2].substr(2), 16)).toNumber();
return {
hash: rpcData[0].lstrip("0x"),
seed_hash: rpcData[1].lstrip("0x"),
difficulty: difficulty
hash: rpcData[0].substr(2),
seed_hash: rpcData[1].substr(2),
difficulty: difficulty,
height: parseInt(rpcData[3])
};
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cryptoforknote-util",
"version": "9.1.0",
"version": "9.1.4",
"main": "cryptoforknote-util",
"author": {
"name": "LucasJones",