Skip to content

Commit 66c9592

Browse files
committed
refactor: use more strict scope v20 instead dip0003
1 parent fc96190 commit 66c9592

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

src/chainparams.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,7 @@ class CRegTestParams : public CChainParams {
921921
UpdateLLMQTestParametersFromArgs(args, Consensus::LLMQType::LLMQ_TEST_INSTANTSEND);
922922
UpdateLLMQTestParametersFromArgs(args, Consensus::LLMQType::LLMQ_TEST_PLATFORM);
923923
UpdateLLMQInstantSendDIP0024FromArgs(args);
924+
assert(consensus.V20Height >= consensus.DIP0003Height);
924925
}
925926

926927
/**

src/evo/cbtx.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,8 @@ std::optional<std::pair<CBLSSignature, uint32_t>> GetNonNullCoinbaseChainlock(co
437437
return std::nullopt;
438438
}
439439

440-
// There's no CbTx before DIP0003 activation
441-
if (!DeploymentActiveAt(*pindex, Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0003)) {
440+
// There's no CL in CbTx before v20 activation
441+
if (!DeploymentActiveAt(*pindex, Params().GetConsensus(), Consensus::DEPLOYMENT_V20)) {
442442
return std::nullopt;
443443
}
444444

@@ -454,14 +454,9 @@ std::optional<std::pair<CBLSSignature, uint32_t>> GetNonNullCoinbaseChainlock(co
454454
return std::nullopt;
455455
}
456456

457-
const CCbTx& cbtx = opt_cbtx.value();
458-
if (cbtx.nVersion < CCbTx::Version::CLSIG_AND_BALANCE) {
457+
if (!opt_cbtx->bestCLSignature.IsValid()) {
459458
return std::nullopt;
460459
}
461460

462-
if (!cbtx.bestCLSignature.IsValid()) {
463-
return std::nullopt;
464-
}
465-
466-
return std::make_pair(cbtx.bestCLSignature, cbtx.bestCLHeightDiff);
461+
return std::make_pair(opt_cbtx->bestCLSignature, opt_cbtx->bestCLHeightDiff);
467462
}

test/functional/feature_assumevalid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class AssumeValidTest(BitcoinTestFramework):
6262
def set_test_params(self):
6363
self.setup_clean_chain = True
6464
self.num_nodes = 3
65-
self.extra_args = ["-dip3params=9000:9000", "-checkblockindex=0"]
65+
self.extra_args = ["-dip3params=9000:9000", '-testactivationheight=v20@9000', "-checkblockindex=0"]
6666
self.rpc_timeout = 120
6767

6868
def setup_network(self):

test/functional/feature_csv_activation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def set_test_params(self):
100100
'-peertimeout=999999', # bump because mocktime might cause a disconnect otherwise
101101
102102
'-dip3params=2000:2000',
103+
'-testactivationheight=v20@2000',
103104
f'-testactivationheight=csv@{CSV_ACTIVATION_HEIGHT}',
104105
'-par=1', # Use only one script thread to get the exact reject reason for testing
105106
]]

0 commit comments

Comments
 (0)