consensus: fail early on pow check when target > 256 bits.
This commit is contained in:
parent
05c38853d7
commit
b6d067ec93
@ -323,6 +323,9 @@ exports.verifyPOW = function verifyPOW(hash, bits) {
|
||||
if (target.isNeg() || target.isZero())
|
||||
return false;
|
||||
|
||||
if (target.bitLength() > 256)
|
||||
return false;
|
||||
|
||||
const num = new BN(hash, 'le');
|
||||
|
||||
if (num.gt(target))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user