Skip to content

Commit

Permalink
Enable CHECKLOCKTIMEVERIFY on version 4 blocks after a 75% majority.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Nicoll authored and schildbach committed Nov 23, 2015
1 parent 70f557a commit ff2e057
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/src/main/java/org/bitcoinj/core/NetworkParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,14 @@ public EnumSet<Script.VerifyFlag> getTransactionVerificationFlags(final Block bl
final EnumSet<Script.VerifyFlag> verifyFlags = EnumSet.noneOf(Script.VerifyFlag.class);
if (block.getTimeSeconds() >= NetworkParameters.BIP16_ENFORCE_TIME)
verifyFlags.add(Script.VerifyFlag.P2SH);

// Start enforcing CHECKLOCKTIMEVERIFY, (BIP65) for block.nVersion=4
// blocks, when 75% of the network has upgraded:
if (block.getVersion() >= Block.BLOCK_VERSION_BIP65 &&
tally.getCountAtOrAbove(Block.BLOCK_VERSION_BIP65) > this.getMajorityEnforceBlockUpgrade()) {
verifyFlags.add(Script.VerifyFlag.CHECKLOCKTIMEVERIFY);
}

return verifyFlags;
}

Expand Down

0 comments on commit ff2e057

Please sign in to comment.