mirror of
https://github.com/status-im/ethereumj-personal.git
synced 2025-01-24 19:00:31 +00:00
Change block difficulty for new GHOST protocol
This commit is contained in:
parent
3542c6c35e
commit
0f8b51158a
@ -366,7 +366,7 @@ public class Block {
|
||||
else {
|
||||
Block parent = this.getParent();
|
||||
long parentDifficulty = new BigInteger(1, parent.getDifficulty()).longValue();
|
||||
long newDifficulty = this.header.getTimestamp() >= parent.getTimestamp() + 42 ? parentDifficulty - (parentDifficulty >> 10) : (parentDifficulty + (parentDifficulty >> 10));
|
||||
long newDifficulty = this.header.getTimestamp() < parent.getTimestamp() + 5 ? parentDifficulty - (parentDifficulty >> 10) : (parentDifficulty + (parentDifficulty >> 10));
|
||||
return BigIntegers.asUnsignedByteArray(BigInteger.valueOf(newDifficulty));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user