Skip to content

Commit 27b2e5c

Browse files
7cc77f3 Merge bitcoin#21373: test: generate fewer blocks in feature_nulldummy to fix timeouts, speed up (MarcoFalke) a933a60 feat: new command line argument -bip147height for bitcoin#21373 (Konstantin Akimov) 5191138 Merge bitcoin#21377: Speedy trial support for versionbits (fanquake) ecade9b Merge bitcoin#21749: test: Bump shellcheck version (W. J. van der Laan) eeec2f2 Merge bitcoin#21884: fuzz: Remove unused --enable-danger-fuzz-link-all option (fanquake) 51633d7 Merge bitcoin#21874: fuzz: Add WRITE_ALL_FUZZ_TARGETS_AND_ABORT (MarcoFalke) a02a2c0 Merge bitcoin#21681: validation: fix ActivateSnapshot to use hardcoded nChainTx (MarcoFalke) 71f23d6 Merge bitcoin#21814: test: Fix feature_config_args.py intermittent issue (MarcoFalke) de4d2a8 Merge bitcoin#21714: refactor: Drop CCoinControl::SetNull (MarcoFalke) a63f9c3 Merge bitcoin-core/gui#284: refactor: Simplify SendCoinsDialog::updateCoinControlState (Hennadii Stepanov) b2d8893 Merge bitcoin#21792: test: Fix intermittent issue in p2p_segwit.py (MarcoFalke) Pull request description: ## Issue being fixed or feature implemented Regular batch of backports from bitcoin v22 ## What was done? Implemented new commandline argument `-bip147height` for RegTest. Backports: - bitcoin#21377 - bitcoin#21792 - bitcoin-core/gui#284 - bitcoin#21714 - bitcoin#21373 - bitcoin#21814 - bitcoin#21681 - bitcoin#21874 - bitcoin#21884 - bitcoin#21749 ## How Has This Been Tested? Run unit/functional tests ## Breaking Changes n/a ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone ACKs for top commit: PastaPastaPasta: utACK 7cc77f3 Tree-SHA512: d46218667430af19c445d67d6411b1e7f19920e85f86e6e74ae7b9062aeb3763637a8613587c203ba8d285ccc3ee755f936141010944cfae8627397e8b8584d3
2 parents 2b1c165 + 7cc77f3 commit 27b2e5c

38 files changed

+438
-316
lines changed

.fuzzbuzz.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

ci/lint/04_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ ${CI_RETRY_EXE} pip3 install vulture==2.3
1717
${CI_RETRY_EXE} pip3 install yq
1818
${CI_RETRY_EXE} pip3 install mypy==0.781
1919

20-
SHELLCHECK_VERSION=v0.7.1
20+
SHELLCHECK_VERSION=v0.7.2
2121
curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar --xz -xf - --directory /tmp/
2222
export PATH="/tmp/shellcheck-${SHELLCHECK_VERSION}:${PATH}"

configure.ac

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,6 @@ AC_ARG_ENABLE([fuzz-binary],
185185
[enable_fuzz_binary=$enableval],
186186
[enable_fuzz_binary=yes])
187187

188-
AC_ARG_ENABLE([danger_fuzz_link_all],
189-
AS_HELP_STRING([--enable-danger-fuzz-link-all],
190-
[Danger! Modifies source code. Needs git and gnu sed installed. Link each fuzz target (default no).]),
191-
[enable_danger_fuzz_link_all=$enableval],
192-
[enable_danger_fuzz_link_all=no])
193-
194188
AC_ARG_WITH([qrencode],
195189
[AS_HELP_STRING([--with-qrencode],
196190
[enable QR code support (default is yes if qt is enabled and libqrencode is found)])],
@@ -1818,7 +1812,6 @@ AM_CONDITIONAL([ENABLE_TRACING],[test x$have_sdt = xyes])
18181812
AM_CONDITIONAL([ENABLE_TESTS],[test x$BUILD_TEST = xyes])
18191813
AM_CONDITIONAL([ENABLE_FUZZ],[test x$enable_fuzz = xyes])
18201814
AM_CONDITIONAL([ENABLE_FUZZ_BINARY],[test x$enable_fuzz_binary = xyes])
1821-
AM_CONDITIONAL([ENABLE_FUZZ_LINK_ALL],[test x$enable_danger_fuzz_link_all = xyes])
18221815
AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt = xyes])
18231816
AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$BUILD_TEST_QT = xyes])
18241817
AM_CONDITIONAL([ENABLE_BENCH],[test x$use_bench = xyes])

src/Makefile.test.include

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,6 @@ univalue_test_object_CPPFLAGS = -I$(srcdir)/$(UNIVALUE_INCLUDE_DIR_INT)
398398
univalue_test_object_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS)
399399
endif
400400

401-
if ENABLE_FUZZ_LINK_ALL
402-
all-local: $(FUZZ_BINARY)
403-
bash ./test/fuzz/danger_link_all.sh
404-
endif
405-
406401
%.cpp.test: %.cpp
407402
@echo Running tests: $$(\
408403
cat $< | \

src/chainparams.cpp

Lines changed: 56 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,12 @@ class CMainParams : public CChainParams {
200200
consensus.fPowNoRetargeting = false;
201201
consensus.nPowKGWHeight = 15200;
202202
consensus.nPowDGWHeight = 34140;
203-
consensus.nRuleChangeActivationThreshold = 1916; // 95% of 2016
203+
consensus.nRuleChangeActivationThreshold = 1815; // 90% of 2016
204204
consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
205205
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
206-
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
207-
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
206+
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = Consensus::BIP9Deployment::NEVER_ACTIVE;
207+
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
208+
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].min_activation_height = 0; // No activation delay
208209

209210
consensus.vDeployments[Consensus::DEPLOYMENT_V20].bit = 9;
210211
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nStartTime = 1700006400; // November 15, 2023
@@ -403,8 +404,9 @@ class CTestNetParams : public CChainParams {
403404
consensus.nRuleChangeActivationThreshold = 1512; // 75% for testchains
404405
consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
405406
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
406-
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
407-
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
407+
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = Consensus::BIP9Deployment::NEVER_ACTIVE;
408+
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
409+
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].min_activation_height = 0; // No activation delay
408410

409411
consensus.vDeployments[Consensus::DEPLOYMENT_V20].bit = 9;
410412
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nStartTime = 1693526400; // Friday, September 1, 2023 0:00:00
@@ -577,8 +579,9 @@ class CDevNetParams : public CChainParams {
577579
consensus.nRuleChangeActivationThreshold = 1512; // 75% for testchains
578580
consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
579581
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
580-
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
581-
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
582+
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = Consensus::BIP9Deployment::NEVER_ACTIVE;
583+
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
584+
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].min_activation_height = 0; // No activation delay
582585

583586
consensus.vDeployments[Consensus::DEPLOYMENT_V20].bit = 9;
584587
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nStartTime = 1661990400; // Sep 1st, 2022
@@ -815,9 +818,11 @@ class CRegTestParams : public CChainParams {
815818
consensus.nPowDGWHeight = 34140; // same as mainnet
816819
consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains
817820
consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016)
821+
818822
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
819823
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0;
820824
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
825+
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].min_activation_height = 0; // No activation delay
821826

822827
consensus.vDeployments[Consensus::DEPLOYMENT_V20].bit = 9;
823828
consensus.vDeployments[Consensus::DEPLOYMENT_V20].nStartTime = 0;
@@ -856,6 +861,7 @@ class CRegTestParams : public CChainParams {
856861
UpdateActivationParametersFromArgs(args);
857862
UpdateDIP3ParametersFromArgs(args);
858863
UpdateDIP8ParametersFromArgs(args);
864+
UpdateBIP147ParametersFromArgs(args);
859865
UpdateBudgetParametersFromArgs(args);
860866

861867
genesis = CreateGenesisBlock(1417713337, 1096447, 0x207fffff, 1, 50 * COIN);
@@ -939,10 +945,11 @@ class CRegTestParams : public CChainParams {
939945
/**
940946
* Allows modifying the Version Bits regtest parameters.
941947
*/
942-
void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout, int64_t nWindowSize, int64_t nThresholdStart, int64_t nThresholdMin, int64_t nFalloffCoeff, int64_t nUseEHF)
948+
void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout, int min_activation_height, int64_t nWindowSize, int64_t nThresholdStart, int64_t nThresholdMin, int64_t nFalloffCoeff, int64_t nUseEHF)
943949
{
944950
consensus.vDeployments[d].nStartTime = nStartTime;
945951
consensus.vDeployments[d].nTimeout = nTimeout;
952+
consensus.vDeployments[d].min_activation_height = min_activation_height;
946953
if (nWindowSize != -1) {
947954
consensus.vDeployments[d].nWindowSize = nWindowSize;
948955
}
@@ -980,6 +987,12 @@ class CRegTestParams : public CChainParams {
980987
}
981988
void UpdateDIP8ParametersFromArgs(const ArgsManager& args);
982989

990+
void UpdateBIP147Parameters(int nActivationHeight)
991+
{
992+
consensus.BIP147Height = nActivationHeight;
993+
}
994+
void UpdateBIP147ParametersFromArgs(const ArgsManager& args);
995+
983996
/**
984997
* Allows modifying the budget regtest parameters.
985998
*/
@@ -1022,45 +1035,50 @@ void CRegTestParams::UpdateActivationParametersFromArgs(const ArgsManager& args)
10221035

10231036
for (const std::string& strDeployment : args.GetArgs("-vbparams")) {
10241037
std::vector<std::string> vDeploymentParams = SplitString(strDeployment, ':');
1025-
if (vDeploymentParams.size() != 3 && vDeploymentParams.size() != 5 && vDeploymentParams.size() != 8) {
1038+
if (vDeploymentParams.size() != 3 && vDeploymentParams.size() != 4 && vDeploymentParams.size() != 6 && vDeploymentParams.size() != 9) {
10261039
throw std::runtime_error("Version bits parameters malformed, expecting "
10271040
"<deployment>:<start>:<end> or "
1028-
"<deployment>:<start>:<end>:<window>:<threshold> or "
1029-
"<deployment>:<start>:<end>:<window>:<thresholdstart>:<thresholdmin>:<falloffcoeff>:<useehf>");
1041+
"<deployment>:<start>:<end>:<min_activation_height> or "
1042+
"<deployment>:<start>:<end>:<min_activation_height>:<window>:<threshold> or "
1043+
"<deployment>:<start>:<end>:<min_activation_height>:<window>:<thresholdstart>:<thresholdmin>:<falloffcoeff>:<useehf>");
10301044
}
10311045
int64_t nStartTime, nTimeout, nWindowSize = -1, nThresholdStart = -1, nThresholdMin = -1, nFalloffCoeff = -1, nUseEHF = -1;
1046+
int min_activation_height = 0;
10321047
if (!ParseInt64(vDeploymentParams[1], &nStartTime)) {
10331048
throw std::runtime_error(strprintf("Invalid nStartTime (%s)", vDeploymentParams[1]));
10341049
}
10351050
if (!ParseInt64(vDeploymentParams[2], &nTimeout)) {
10361051
throw std::runtime_error(strprintf("Invalid nTimeout (%s)", vDeploymentParams[2]));
10371052
}
1038-
if (vDeploymentParams.size() >= 5) {
1039-
if (!ParseInt64(vDeploymentParams[3], &nWindowSize)) {
1040-
throw std::runtime_error(strprintf("Invalid nWindowSize (%s)", vDeploymentParams[3]));
1053+
if (vDeploymentParams.size() >= 4 && !ParseInt32(vDeploymentParams[3], &min_activation_height)) {
1054+
throw std::runtime_error(strprintf("Invalid min_activation_height (%s)", vDeploymentParams[3]));
1055+
}
1056+
if (vDeploymentParams.size() >= 6) {
1057+
if (!ParseInt64(vDeploymentParams[4], &nWindowSize)) {
1058+
throw std::runtime_error(strprintf("Invalid nWindowSize (%s)", vDeploymentParams[4]));
10411059
}
1042-
if (!ParseInt64(vDeploymentParams[4], &nThresholdStart)) {
1043-
throw std::runtime_error(strprintf("Invalid nThresholdStart (%s)", vDeploymentParams[4]));
1060+
if (!ParseInt64(vDeploymentParams[5], &nThresholdStart)) {
1061+
throw std::runtime_error(strprintf("Invalid nThresholdStart (%s)", vDeploymentParams[5]));
10441062
}
10451063
}
1046-
if (vDeploymentParams.size() == 8) {
1047-
if (!ParseInt64(vDeploymentParams[5], &nThresholdMin)) {
1048-
throw std::runtime_error(strprintf("Invalid nThresholdMin (%s)", vDeploymentParams[5]));
1064+
if (vDeploymentParams.size() == 9) {
1065+
if (!ParseInt64(vDeploymentParams[6], &nThresholdMin)) {
1066+
throw std::runtime_error(strprintf("Invalid nThresholdMin (%s)", vDeploymentParams[6]));
10491067
}
1050-
if (!ParseInt64(vDeploymentParams[6], &nFalloffCoeff)) {
1051-
throw std::runtime_error(strprintf("Invalid nFalloffCoeff (%s)", vDeploymentParams[6]));
1068+
if (!ParseInt64(vDeploymentParams[7], &nFalloffCoeff)) {
1069+
throw std::runtime_error(strprintf("Invalid nFalloffCoeff (%s)", vDeploymentParams[7]));
10521070
}
1053-
if (!ParseInt64(vDeploymentParams[7], &nUseEHF)) {
1054-
throw std::runtime_error(strprintf("Invalid nUseEHF (%s)", vDeploymentParams[7]));
1071+
if (!ParseInt64(vDeploymentParams[8], &nUseEHF)) {
1072+
throw std::runtime_error(strprintf("Invalid nUseEHF (%s)", vDeploymentParams[8]));
10551073
}
10561074
}
10571075
bool found = false;
10581076
for (int j=0; j < (int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; ++j) {
10591077
if (vDeploymentParams[0] == VersionBitsDeploymentInfo[j].name) {
1060-
UpdateVersionBitsParameters(Consensus::DeploymentPos(j), nStartTime, nTimeout, nWindowSize, nThresholdStart, nThresholdMin, nFalloffCoeff, nUseEHF);
1078+
UpdateVersionBitsParameters(Consensus::DeploymentPos(j), nStartTime, nTimeout, min_activation_height, nWindowSize, nThresholdStart, nThresholdMin, nFalloffCoeff, nUseEHF);
10611079
found = true;
1062-
LogPrintf("Setting version bits activation parameters for %s to start=%ld, timeout=%ld, window=%ld, thresholdstart=%ld, thresholdmin=%ld, falloffcoeff=%ld, useehf=%ld\n",
1063-
vDeploymentParams[0], nStartTime, nTimeout, nWindowSize, nThresholdStart, nThresholdMin, nFalloffCoeff, nUseEHF);
1080+
LogPrintf("Setting version bits activation parameters for %s to start=%ld, timeout=%ld, min_activation_height=%ld, window=%ld, thresholdstart=%ld, thresholdmin=%ld, falloffcoeff=%ld, useehf=%ld\n",
1081+
vDeploymentParams[0], nStartTime, nTimeout, min_activation_height, nWindowSize, nThresholdStart, nThresholdMin, nFalloffCoeff, nUseEHF);
10641082
break;
10651083
}
10661084
}
@@ -1107,6 +1125,18 @@ void CRegTestParams::UpdateDIP8ParametersFromArgs(const ArgsManager& args)
11071125
UpdateDIP8Parameters(nDIP8ActivationHeight);
11081126
}
11091127

1128+
void CRegTestParams::UpdateBIP147ParametersFromArgs(const ArgsManager& args)
1129+
{
1130+
if (!args.IsArgSet("-bip147height")) return;
1131+
int nBIP147Height;
1132+
const std::string strParams = args.GetArg("-bip147height", "");
1133+
if (!ParseInt32(strParams, &nBIP147Height)) {
1134+
throw std::runtime_error(strprintf("Invalid activation height (%s)", strParams));
1135+
}
1136+
LogPrintf("Setting BIP147 parameters to activation=%lld\n", nBIP147Height);
1137+
UpdateBIP147Parameters(nBIP147Height);
1138+
}
1139+
11101140
void CRegTestParams::UpdateBudgetParametersFromArgs(const ArgsManager& args)
11111141
{
11121142
if (!args.IsArgSet("-budgetparams")) return;

src/chainparamsbase.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ void SetupChainParamsBaseOptions(ArgsManager& argsman)
2121
argsman.AddArg("-devnet=<name>", "Use devnet chain with provided name", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
2222
argsman.AddArg("-dip3params=<activation>:<enforcement>", "Override DIP3 activation and enforcement heights (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
2323
argsman.AddArg("-dip8params=<activation>", "Override DIP8 activation height (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
24+
argsman.AddArg("-bip147height=<activation>", "Override BIP147 activation height (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
2425
argsman.AddArg("-highsubsidyblocks=<n>", "The number of blocks with a higher than normal subsidy to mine at the start of a chain. Block after that height will have fixed subsidy base. (default: 0, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
2526
argsman.AddArg("-highsubsidyfactor=<n>", "The factor to multiply the normal block subsidy by while in the highsubsidyblocks window of a chain (default: 1, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
2627
argsman.AddArg("-llmqchainlocks=<quorum name>", "Override the default LLMQ type used for ChainLocks. Allows using ChainLocks with smaller LLMQs. (default: llmq_devnet, devnet-only)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
@@ -37,8 +38,8 @@ void SetupChainParamsBaseOptions(ArgsManager& argsman)
3738
argsman.AddArg("-regtest", "Enter regression test mode, which uses a special chain in which blocks can be solved instantly. "
3839
"This is intended for regression testing tools and app development. Equivalent to -chain=regtest", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
3940
argsman.AddArg("-testnet", "Use the test chain. Equivalent to -chain=test", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS);
40-
argsman.AddArg("-vbparams=<deployment>:<start>:<end>(:<window>:<threshold/thresholdstart>(:<thresholdmin>:<falloffcoeff>:<mnactivation>))",
41-
"Use given start/end times for specified version bits deployment (regtest-only). "
41+
argsman.AddArg("-vbparams=<deployment>:<start>:<end>(:min_activation_height(:<window>:<threshold/thresholdstart>(:<thresholdmin>:<falloffcoeff>:<mnactivation>)))",
42+
"Use given start/end times and min_activation_height for specified version bits deployment (regtest-only). "
4243
"Specifying window, threshold/thresholdstart, thresholdmin, falloffcoeff and mnactivation is optional.", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS);
4344

4445
}

src/consensus/params.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ struct BIP9Deployment {
5151
int64_t nStartTime;
5252
/** Timeout/expiry MedianTime for the deployment attempt. */
5353
int64_t nTimeout;
54+
/** If lock in occurs, delay activation until at least this block
55+
* height. Note that activation will only occur on a retarget
56+
* boundary.
57+
*/
58+
int min_activation_height{0};
5459
/** The number of past blocks (including the block under consideration) to be taken into account for locking in a fork. */
5560
int64_t nWindowSize{0};
5661
/** A starting number of blocks, in the range of 1..nWindowSize, which must signal for a fork in order to lock it in. */
@@ -73,6 +78,11 @@ struct BIP9Deployment {
7378
* process (which takes at least 3 BIP9 intervals). Only tests that specifically test the
7479
* behaviour during activation cannot use this. */
7580
static constexpr int64_t ALWAYS_ACTIVE = -1;
81+
82+
/** Special value for nStartTime indicating that the deployment is never active.
83+
* This is useful for integrating the code changes for a new feature
84+
* prior to deploying it on some or all networks. */
85+
static constexpr int64_t NEVER_ACTIVE = -2;
7686
};
7787

7888
/**

src/evo/mnhftx.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ CMNHFManager::~CMNHFManager()
5555
CMNHFManager::Signals CMNHFManager::GetSignalsStage(const CBlockIndex* const pindexPrev)
5656
{
5757
Signals signals = GetForBlock(pindexPrev);
58+
if (pindexPrev == nullptr) return {};
5859
const int height = pindexPrev->nHeight + 1;
5960
for (auto it = signals.begin(); it != signals.end(); ) {
6061
bool found{false};

src/node/utxo_snapshot.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,15 @@ class SnapshotMetadata
2222
//! during snapshot load to estimate progress of UTXO set reconstruction.
2323
uint64_t m_coins_count = 0;
2424

25-
//! Necessary to "fake" the base nChainTx so that we can estimate progress during
26-
//! initial block download for the assumeutxo chainstate.
27-
unsigned int m_nchaintx = 0;
28-
2925
SnapshotMetadata() { }
3026
SnapshotMetadata(
3127
const uint256& base_blockhash,
3228
uint64_t coins_count,
3329
unsigned int nchaintx) :
3430
m_base_blockhash(base_blockhash),
35-
m_coins_count(coins_count),
36-
m_nchaintx(nchaintx) { }
31+
m_coins_count(coins_count) { }
3732

38-
SERIALIZE_METHODS(SnapshotMetadata, obj) { READWRITE(obj.m_base_blockhash, obj.m_coins_count, obj.m_nchaintx); }
33+
SERIALIZE_METHODS(SnapshotMetadata, obj) { READWRITE(obj.m_base_blockhash, obj.m_coins_count); }
3934
};
4035

4136
#endif // BITCOIN_NODE_UTXO_SNAPSHOT_H

0 commit comments

Comments
 (0)