From 82a47f5432982389c17b44dff129426278881a5e Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Thu, 11 Apr 2019 14:41:51 +0200 Subject: [PATCH] Allow testing ChainLocks enforcement with spork19 == 1 (#2854) This is only for testnet. --- src/llmq/quorums_chainlocks.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/llmq/quorums_chainlocks.cpp b/src/llmq/quorums_chainlocks.cpp index eb6a05eb2..21c85239d 100644 --- a/src/llmq/quorums_chainlocks.cpp +++ b/src/llmq/quorums_chainlocks.cpp @@ -214,12 +214,13 @@ void CChainLocksHandler::CheckActiveState() LOCK(cs); bool oldIsEnforced = isEnforced; isSporkActive = sporkManager.IsSporkActive(SPORK_19_CHAINLOCKS_ENABLED); - isEnforced = fDIP0008Active && isSporkActive; - + // TODO remove this after DIP8 is active + bool fEnforcedBySpork = (Params().NetworkIDString() == CBaseChainParams::TESTNET) && (sporkManager.GetSporkValue(SPORK_19_CHAINLOCKS_ENABLED) == 1); + isEnforced = (fDIP0008Active && isSporkActive) || fEnforcedBySpork; if (!oldIsEnforced && isEnforced) { // ChainLocks got activated just recently, but it's possible that it was already running before, leaving - // us with some stale values which we should not try to enforce anymore (there probably was a good reason to + // us with some stale values which we should not try to enforce anymore (there probably was a good reason // to disable spork19) bestChainLockHash = uint256(); bestChainLock = bestChainLockWithKnownBlock = CChainLockSig();