Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Commit

Permalink
Added Byzantium difficulty bomb delay
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerd77 committed Sep 22, 2017
1 parent ab2af56 commit 514179e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion header.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,13 @@ BlockHeader.prototype.canonicalDifficulty = function (parentBlock) {
}
dif = parentDif.add(offset.mul(a))

var exp = new BN(this.number).idivn(100000).isubn(2)
// Byzantium difficulty bomb delay
var num = new BN(this.number).isubn(3000000)
if (num.ltn(0)) {
num = new BN(0)
}

var exp = num.idivn(100000).isubn(2)
if (!exp.isNeg()) {
dif.iadd(new BN(2).pow(exp))
}
Expand Down

0 comments on commit 514179e

Please sign in to comment.