Enable CHECKLOCKTIMEVERIFY on version 4 blocks after a 75% majority.

This commit is contained in:
Ross Nicoll
2015-11-07 14:47:46 +00:00
committed by Andreas Schildbach
parent 70f557a514
commit ff2e057126

View File

@@ -510,6 +510,14 @@ public abstract class NetworkParameters {
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;
}