Eth draft support
This commit is contained in:
13
index.js
13
index.js
@@ -55,12 +55,12 @@ function getMerkleRoot(transactions) {
|
|||||||
let last_epoch_number;
|
let last_epoch_number;
|
||||||
let last_seed_hash;
|
let last_seed_hash;
|
||||||
|
|
||||||
module.exports.baseRavenDiff = function() {
|
module.exports.baseDiff = function() {
|
||||||
return parseInt('0x00000000ff000000000000000000000000000000000000000000000000000000');
|
return bignum('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF', 16);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.baseEthDiff = function() {
|
module.exports.baseRavenDiff = function() {
|
||||||
return parseInt('0x00000000ffff0000000000000000000000000000000000000000000000000000');
|
return parseInt('0x00000000ff000000000000000000000000000000000000000000000000000000');
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.RavenBlockTemplate = function(rpcData, poolAddress) {
|
module.exports.RavenBlockTemplate = function(rpcData, poolAddress) {
|
||||||
@@ -182,10 +182,11 @@ module.exports.constructNewDeroBlob = function(blockTemplate, nonceBuff) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
module.exports.EthBlockTemplate = function(rpcData) {
|
module.exports.EthBlockTemplate = function(rpcData) {
|
||||||
const difficulty = parseFloat((module.exports.baseEthDiff() / bignum(rpcData[2].substr(2), 16).toNumber()).toFixed(19));
|
const difficulty = (module.exports.baseDiff() / bignum(rpcData[2].substr(2), 16)).toNumber();
|
||||||
return {
|
return {
|
||||||
hash: rpcData[0].substr(2),
|
hash: rpcData[0].substr(2),
|
||||||
seed_hash: rpcData[1].substr(2),
|
seed_hash: rpcData[1].substr(2),
|
||||||
difficulty: difficulty
|
difficulty: difficulty,
|
||||||
|
height: parseInt(rpcData[3])
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cryptoforknote-util",
|
"name": "cryptoforknote-util",
|
||||||
"version": "9.1.2",
|
"version": "9.1.3",
|
||||||
"main": "cryptoforknote-util",
|
"main": "cryptoforknote-util",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "LucasJones",
|
"name": "LucasJones",
|
||||||
|
|||||||
Reference in New Issue
Block a user