Skip to content

Commit

Permalink
feat: check maximum difficulty increase
Browse files Browse the repository at this point in the history
  • Loading branch information
reednaa committed Oct 28, 2024
1 parent 874920a commit a1f0ff3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/BtcPrism.sol
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ contract BtcPrism is IBtcPrism {
// https://blog.lopp.net/the-block-storms-of-bitcoins-testnet/
if (!isTestnet) {
if (target >> 2 >= lastTarget) revert DifficultyRetargetLT25();
if (target << 2 <= lastTarget) revert DifficultyRetargetLT25();
}
periodToTarget[period] = target;
} else if (!isTestnet) {
Expand Down

0 comments on commit a1f0ff3

Please sign in to comment.