10
10
#include " chain.h"
11
11
#include " net_processing.h"
12
12
#include " scheduler.h"
13
+ #include " spork.h"
13
14
#include " validation.h"
14
15
15
16
namespace llmq
@@ -56,6 +57,10 @@ bool CChainLocksHandler::GetChainLockByHash(const uint256& hash, llmq::CChainLoc
56
57
57
58
void CChainLocksHandler::ProcessMessage (CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, CConnman& connman)
58
59
{
60
+ if (!sporkManager.IsSporkActive (SPORK_19_CHAINLOCKS_ENABLED)) {
61
+ return ;
62
+ }
63
+
59
64
if (strCommand == NetMsgType::CLSIG) {
60
65
CChainLockSig clsig;
61
66
vRecv >> clsig;
@@ -171,6 +176,9 @@ void CChainLocksHandler::UpdatedBlockTip(const CBlockIndex* pindexNew, const CBl
171
176
if (!pindexNew->pprev ) {
172
177
return ;
173
178
}
179
+ if (!sporkManager.IsSporkActive (SPORK_19_CHAINLOCKS_ENABLED)) {
180
+ return ;
181
+ }
174
182
175
183
// DIP8 defines a process called "Signing attempts" which should run before the CLSIG is finalized
176
184
// To simplify the initial implementation, we skip this process and directly try to create a CLSIG
@@ -257,6 +265,10 @@ void CChainLocksHandler::EnforceBestChainLock()
257
265
258
266
void CChainLocksHandler::HandleNewRecoveredSig (const llmq::CRecoveredSig& recoveredSig)
259
267
{
268
+ if (!sporkManager.IsSporkActive (SPORK_19_CHAINLOCKS_ENABLED)) {
269
+ return ;
270
+ }
271
+
260
272
CChainLockSig clsig;
261
273
{
262
274
LOCK (cs);
@@ -316,6 +328,10 @@ void CChainLocksHandler::DoInvalidateBlock(const CBlockIndex* pindex, bool activ
316
328
317
329
bool CChainLocksHandler::HasChainLock (int nHeight, const uint256& blockHash)
318
330
{
331
+ if (!sporkManager.IsSporkActive (SPORK_19_CHAINLOCKS_ENABLED)) {
332
+ return false ;
333
+ }
334
+
319
335
LOCK (cs);
320
336
return InternalHasChainLock (nHeight, blockHash);
321
337
}
@@ -342,6 +358,10 @@ bool CChainLocksHandler::InternalHasChainLock(int nHeight, const uint256& blockH
342
358
343
359
bool CChainLocksHandler::HasConflictingChainLock (int nHeight, const uint256& blockHash)
344
360
{
361
+ if (!sporkManager.IsSporkActive (SPORK_19_CHAINLOCKS_ENABLED)) {
362
+ return false ;
363
+ }
364
+
345
365
LOCK (cs);
346
366
return InternalHasConflictingChainLock (nHeight, blockHash);
347
367
}
0 commit comments