Allow large block difficulty, but set it to null for PoA (#152).
This commit is contained in:
parent
96d420e832
commit
28ddf485ed
@ -92,6 +92,18 @@ function checkNumber(number) {
|
|||||||
return utils.bigNumberify(number).toNumber();
|
return utils.bigNumberify(number).toNumber();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkDifficulty(number) {
|
||||||
|
var value = utils.bigNumberify(number);
|
||||||
|
|
||||||
|
try {
|
||||||
|
value = value.toNumber();
|
||||||
|
} catch (error) {
|
||||||
|
value = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
function checkBoolean(value) {
|
function checkBoolean(value) {
|
||||||
if (typeof(value) === 'boolean') { return value; }
|
if (typeof(value) === 'boolean') { return value; }
|
||||||
if (typeof(value) === 'string') {
|
if (typeof(value) === 'string') {
|
||||||
@ -141,7 +153,7 @@ var formatBlock = {
|
|||||||
|
|
||||||
timestamp: checkNumber,
|
timestamp: checkNumber,
|
||||||
nonce: allowNull(utils.hexlify),
|
nonce: allowNull(utils.hexlify),
|
||||||
difficulty: allowNull(checkNumber),
|
difficulty: checkDifficulty,
|
||||||
|
|
||||||
gasLimit: utils.bigNumberify,
|
gasLimit: utils.bigNumberify,
|
||||||
gasUsed: utils.bigNumberify,
|
gasUsed: utils.bigNumberify,
|
||||||
|
Loading…
Reference in New Issue
Block a user