Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ff4a38a
build: Fix configuring depends with cmake
hebasto Feb 19, 2022
62e1428
doc: Add note that -reindex will rebuild optional indexes
mzumsande Apr 6, 2022
9cc8e87
refactor: introduce single-separator split helper `SplitString`
theStack Sep 11, 2021
4fad7e4
test: add unit tests for `SplitString` helper
kiminuo Sep 13, 2021
a62e844
fuzz: add `SplitString` fuzz target
Sep 13, 2021
912f1ed
wallet: track which coin selection algorithm produced a SelectionResult
achow101 Mar 21, 2022
15b5838
wallet: compute waste for SelectionResults of preset inputs
achow101 Mar 23, 2022
8e3f39e
wallet: Add some tracepoints for coin selection
achow101 Mar 21, 2022
a237a06
scripted-diff: rename cs_totalBytesSent -> m_total_bytes_sent_mutex
w0xlt Jan 25, 2022
fa1970f
Make BlockManager::LoadBlockIndex private
Apr 19, 2022
ca02b68
doc: document coin selection tracepoints
achow101 Apr 14, 2022
ab5af9c
test: Add test for coinselection tracepoints
achow101 Apr 14, 2022
8be75fd
p2p: add assertions and negative TS annotations for `m_total_bytes_se…
w0xlt Jan 25, 2022
709af67
p2p: replace RecursiveMutex `m_total_bytes_sent_mutex` with Mutex
w0xlt Jan 25, 2022
dac44fc
init: disallow reindex-chainstate with optional indexes
mzumsande Apr 6, 2022
b8f17fb
[tests] Move TxOrphange tests to orphange_tests.cpp
jnewbery Feb 7, 2022
fa870e3
Remove not needed clang-format off comments
Apr 24, 2022
4637bbe
rpc: Explain active and internal in listdescriptors
achow101 Apr 25, 2022
df08c23
Precomputed hashes are note #16 in BIP341
instagibbs Apr 25, 2022
231fc7b
refactor: Introduce GetFirstStoredBlock helper function
fjahr Apr 18, 2021
2561823
blockstorage: Add prune locks to BlockManager
fjahr May 13, 2021
f08c9fb
Index: Use prune locks for blockfilterindex
fjahr Apr 18, 2021
825d198
Index: Allow coinstatsindex with pruning enabled
fjahr May 13, 2021
de08932
test: Update test for indices on pruned nodes
fjahr May 13, 2021
71c3f03
move-only: Rename index + pruning functional test
fjahr May 13, 2021
1ae65b4
Merge bitcoin/bitcoin#24968: Move only: Move TxOrphange tests to orph…
Apr 26, 2022
a19f641
Merge bitcoin/bitcoin#24157: p2p: Replace RecursiveMutex `cs_totalByt…
laanwj Apr 26, 2022
bae4561
scripted-diff: rename BytePtr to AsBytePtr
promag Apr 26, 2022
f436bfd
Merge bitcoin/bitcoin#22953: refactor: introduce single-separator spl…
fanquake Apr 26, 2022
e532748
Don't use zero as null pointer constant (-Wzero-as-null-pointer-const…
practicalswift Jul 30, 2018
9c96f10
tidy: enable modernize-use-nullptr
fanquake Apr 25, 2022
30c1c6e
Merge bitcoin/bitcoin#24979: Precomputed hashes are note #16 in BIP341
fanquake Apr 26, 2022
269dcad
Merge bitcoin/bitcoin#24789: init, index: disallow indexes when runni…
fanquake Apr 26, 2022
23ebd7a
Merge bitcoin/bitcoin#24959: Remove not needed clang-format off comments
laanwj Apr 26, 2022
cc3877f
Merge bitcoin/bitcoin#24971: tidy: modernize-use-nullptr
fanquake Apr 26, 2022
f4005af
Merge bitcoin/bitcoin#24977: rpc: Explain active and internal in list…
fanquake Apr 26, 2022
f654cdb
Merge bitcoin/bitcoin#24392: build: Fix configuring depends with cmake
fanquake Apr 26, 2022
833add0
Merge bitcoin/bitcoin#24989: scripted-diff: rename BytePtr to AsBytePtr
fanquake Apr 26, 2022
260ede1
Merge bitcoin/bitcoin#24644: wallet: add tracepoints and algorithm in…
fanquake Apr 26, 2022
34ae04d
Merge bitcoin/bitcoin#21726: Improve Indices on pruned nodes via prun…
fanquake Apr 26, 2022
bd616bc
Merge bitcoin/bitcoin#24917: Make BlockManager::LoadBlockIndex private
fanquake Apr 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/test/06_script_a.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then
fi

if [[ "${RUN_TIDY}" == "true" ]]; then
MAYBE_BEAR="bear"
MAYBE_BEAR="bear --config src/.bear-tidy-config"
MAYBE_TOKEN="--"
fi

Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1935,6 +1935,7 @@ AC_CONFIG_LINKS([contrib/devtools/test-security-check.py:contrib/devtools/test-s
AC_CONFIG_LINKS([contrib/devtools/test-symbol-check.py:contrib/devtools/test-symbol-check.py])
AC_CONFIG_LINKS([contrib/filter-lcov.py:contrib/filter-lcov.py])
AC_CONFIG_LINKS([contrib/macdeploy/background.tiff:contrib/macdeploy/background.tiff])
AC_CONFIG_LINKS([src/.bear-tidy-config:src/.bear-tidy-config])
AC_CONFIG_LINKS([src/.clang-tidy:src/.clang-tidy])
AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py])
AC_CONFIG_LINKS([test/fuzz/test_runner.py:test/fuzz/test_runner.py])
Expand Down
2 changes: 1 addition & 1 deletion depends/hosts/mingw32.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS)

mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC

mingw_cmake_system=Windows
mingw32_cmake_system=Windows
43 changes: 43 additions & 0 deletions doc/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,49 @@ Arguments passed:
4. Value of the coin as `int64`
5. If the coin is a coinbase as `bool`

### Context `coin_selection`

#### Tracepoint `coin_selection:selected_coins`

Is called when `SelectCoins` completes.

Arguments passed:
1. Wallet name as `pointer to C-style string`
2. Coin selection algorithm name as `pointer to C-style string`
3. Selection target value as `int64`
4. Calculated waste metric of the solution as `int64`
5. Total value of the selected inputs as `int64`

#### Tracepoint `coin_selection:normal_create_tx_internal`

Is called when the first `CreateTransactionInternal` completes.

Arguments passed:
1. Wallet name as `pointer to C-style string`
2. Whether `CreateTransactionInternal` succeeded as `bool`
3. The expected transaction fee as an `int64`
4. The position of the change output as an `int32`

#### Tracepoint `coin_selection:attempting_aps_create_tx`

Is called when `CreateTransactionInternal` is called the second time for the optimistic
Avoid Partial Spends selection attempt. This is used to determine whether the next
tracepoints called are for the Avoid Partial Spends solution, or a different transaction.

Arguments passed:
1. Wallet name as `pointer to C-style string`

#### Tracepoint `coin_selection:aps_create_tx_internal`

Is called when the second `CreateTransactionInternal` with Avoid Partial Spends enabled completes.

Arguments passed:
1. Wallet name as `pointer to C-style string`
2. Whether the Avoid Partial Spends solution will be used as `bool`
3. Whether `CreateTransactionInternal` succeeded as` bool`
4. The expected transaction fee as an `int64`
5. The position of the change output as an `int32`

## Adding tracepoints to Bitcoin Core

To add a new tracepoint, `#include <util/trace.h>` in the compilation unit where
Expand Down
15 changes: 15 additions & 0 deletions src/.bear-tidy-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"output": {
"content": {
"include_only_existing_source": true,
"paths_to_include": [],
"paths_to_exclude": [
"src/leveldb"
]
},
"format": {
"command_as_array": true,
"drop_output_field": false
}
}
}
4 changes: 2 additions & 2 deletions src/.clang-tidy
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Checks: '-*,bugprone-argument-comment'
WarningsAsErrors: bugprone-argument-comment
Checks: '-*,bugprone-argument-comment,modernize-use-nullptr'
WarningsAsErrors: 'bugprone-argument-comment,modernize-use-nullptr'
1 change: 1 addition & 0 deletions src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ BITCOIN_TESTS =\
test/net_peer_eviction_tests.cpp \
test/net_tests.cpp \
test/netbase_tests.cpp \
test/orphanage_tests.cpp \
test/pmt_tests.cpp \
test/policy_fee_tests.cpp \
test/policyestimator_tests.cpp \
Expand Down
17 changes: 5 additions & 12 deletions src/bitcoin-tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
#include <memory>
#include <stdio.h>

#include <boost/algorithm/string.hpp>

static bool fCreateBlank;
static std::map<std::string,UniValue> registers;
static const int CONTINUE_EXECUTION=-1;
Expand Down Expand Up @@ -251,8 +249,7 @@ static T TrimAndParse(const std::string& int_str, const std::string& err)

static void MutateTxAddInput(CMutableTransaction& tx, const std::string& strInput)
{
std::vector<std::string> vStrInputParts;
boost::split(vStrInputParts, strInput, boost::is_any_of(":"));
std::vector<std::string> vStrInputParts = SplitString(strInput, ':');

// separate TXID:VOUT in string
if (vStrInputParts.size()<2)
Expand Down Expand Up @@ -287,8 +284,7 @@ static void MutateTxAddInput(CMutableTransaction& tx, const std::string& strInpu
static void MutateTxAddOutAddr(CMutableTransaction& tx, const std::string& strInput)
{
// Separate into VALUE:ADDRESS
std::vector<std::string> vStrInputParts;
boost::split(vStrInputParts, strInput, boost::is_any_of(":"));
std::vector<std::string> vStrInputParts = SplitString(strInput, ':');

if (vStrInputParts.size() != 2)
throw std::runtime_error("TX output missing or too many separators");
Expand All @@ -312,8 +308,7 @@ static void MutateTxAddOutAddr(CMutableTransaction& tx, const std::string& strIn
static void MutateTxAddOutPubKey(CMutableTransaction& tx, const std::string& strInput)
{
// Separate into VALUE:PUBKEY[:FLAGS]
std::vector<std::string> vStrInputParts;
boost::split(vStrInputParts, strInput, boost::is_any_of(":"));
std::vector<std::string> vStrInputParts = SplitString(strInput, ':');

if (vStrInputParts.size() < 2 || vStrInputParts.size() > 3)
throw std::runtime_error("TX output missing or too many separators");
Expand Down Expand Up @@ -356,8 +351,7 @@ static void MutateTxAddOutPubKey(CMutableTransaction& tx, const std::string& str
static void MutateTxAddOutMultiSig(CMutableTransaction& tx, const std::string& strInput)
{
// Separate into VALUE:REQUIRED:NUMKEYS:PUBKEY1:PUBKEY2:....[:FLAGS]
std::vector<std::string> vStrInputParts;
boost::split(vStrInputParts, strInput, boost::is_any_of(":"));
std::vector<std::string> vStrInputParts = SplitString(strInput, ':');

// Check that there are enough parameters
if (vStrInputParts.size()<3)
Expand Down Expand Up @@ -460,8 +454,7 @@ static void MutateTxAddOutData(CMutableTransaction& tx, const std::string& strIn
static void MutateTxAddOutScript(CMutableTransaction& tx, const std::string& strInput)
{
// separate VALUE:SCRIPT[:FLAGS]
std::vector<std::string> vStrInputParts;
boost::split(vStrInputParts, strInput, boost::is_any_of(":"));
std::vector<std::string> vStrInputParts = SplitString(strInput, ':');
if (vStrInputParts.size() < 2)
throw std::runtime_error("TX output missing separator");

Expand Down
7 changes: 2 additions & 5 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
#include <deploymentinfo.h>
#include <hash.h> // for signet block challenge hash
#include <script/interpreter.h>
#include <util/string.h>
#include <util/system.h>

#include <assert.h>

#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>

static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
{
CMutableTransaction txNew;
Expand Down Expand Up @@ -528,8 +526,7 @@ void CRegTestParams::UpdateActivationParametersFromArgs(const ArgsManager& args)
if (!args.IsArgSet("-vbparams")) return;

for (const std::string& strDeployment : args.GetArgs("-vbparams")) {
std::vector<std::string> vDeploymentParams;
boost::split(vDeploymentParams, strDeployment, boost::is_any_of(":"));
std::vector<std::string> vDeploymentParams = SplitString(strDeployment, ':');
if (vDeploymentParams.size() < 3 || 4 < vDeploymentParams.size()) {
throw std::runtime_error("Version bits parameters malformed, expecting deployment:start:end[:min_activation_height]");
}
Expand Down
33 changes: 20 additions & 13 deletions src/index/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,17 @@ bool BaseIndex::Init()
LOCK(cs_main);
CChain& active_chain = m_chainstate->m_chain;
if (locator.IsNull()) {
m_best_block_index = nullptr;
SetBestBlockIndex(nullptr);
} else {
m_best_block_index = m_chainstate->FindForkInGlobalIndex(locator);
SetBestBlockIndex(m_chainstate->FindForkInGlobalIndex(locator));
}
m_synced = m_best_block_index.load() == active_chain.Tip();
if (!m_synced) {
bool prune_violation = false;
if (!m_best_block_index) {
// index is not built yet
// make sure we have all block data back to the genesis
const CBlockIndex* block = active_chain.Tip();
while (block->pprev && (block->pprev->nStatus & BLOCK_HAVE_DATA)) {
block = block->pprev;
}
prune_violation = block != active_chain.Genesis();
prune_violation = node::GetFirstStoredBlock(active_chain.Tip()) != active_chain.Genesis();
}
// in case the index has a best block set and is not fully synced
// check if we have the required blocks to continue building the index
Expand Down Expand Up @@ -138,7 +134,7 @@ void BaseIndex::ThreadSync()
int64_t last_locator_write_time = 0;
while (true) {
if (m_interrupt) {
m_best_block_index = pindex;
SetBestBlockIndex(pindex);
// No need to handle errors in Commit. If it fails, the error will be already be
// logged. The best way to recover is to continue, as index cannot be corrupted by
// a missed commit to disk for an advanced index state.
Expand All @@ -150,7 +146,7 @@ void BaseIndex::ThreadSync()
LOCK(cs_main);
const CBlockIndex* pindex_next = NextSyncBlock(pindex, m_chainstate->m_chain);
if (!pindex_next) {
m_best_block_index = pindex;
SetBestBlockIndex(pindex);
m_synced = true;
// No need to handle errors in Commit. See rationale above.
Commit();
Expand All @@ -172,7 +168,7 @@ void BaseIndex::ThreadSync()
}

if (last_locator_write_time + SYNC_LOCATOR_WRITE_INTERVAL < current_time) {
m_best_block_index = pindex;
SetBestBlockIndex(pindex);
last_locator_write_time = current_time;
// No need to handle errors in Commit. See rationale above.
Commit();
Expand Down Expand Up @@ -230,10 +226,10 @@ bool BaseIndex::Rewind(const CBlockIndex* current_tip, const CBlockIndex* new_ti
// out of sync may be possible but a users fault.
// In case we reorg beyond the pruned depth, ReadBlockFromDisk would
// throw and lead to a graceful shutdown
m_best_block_index = new_tip;
SetBestBlockIndex(new_tip);
if (!Commit()) {
// If commit fails, revert the best block index to avoid corruption.
m_best_block_index = current_tip;
SetBestBlockIndex(current_tip);
return false;
}

Expand Down Expand Up @@ -274,7 +270,7 @@ void BaseIndex::BlockConnected(const std::shared_ptr<const CBlock>& block, const
}

if (WriteBlock(*block, pindex)) {
m_best_block_index = pindex;
SetBestBlockIndex(pindex);
} else {
FatalError("%s: Failed to write block %s to index",
__func__, pindex->GetBlockHash().ToString());
Expand Down Expand Up @@ -381,3 +377,14 @@ IndexSummary BaseIndex::GetSummary() const
summary.best_block_height = m_best_block_index ? m_best_block_index.load()->nHeight : 0;
return summary;
}

void BaseIndex::SetBestBlockIndex(const CBlockIndex* block) {
assert(!node::fPruneMode || AllowPrune());

m_best_block_index = block;
if (AllowPrune() && block) {
node::PruneLockInfo prune_lock;
prune_lock.height_first = block->nHeight;
WITH_LOCK(::cs_main, m_chainstate->m_blockman.UpdatePruneLock(GetName(), prune_lock));
}
}
6 changes: 6 additions & 0 deletions src/index/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ class BaseIndex : public CValidationInterface
/// to a chain reorganization), the index must halt until Commit succeeds or else it could end up
/// getting corrupted.
bool Commit();

virtual bool AllowPrune() const = 0;

protected:
CChainState* m_chainstate{nullptr};

Expand Down Expand Up @@ -103,6 +106,9 @@ class BaseIndex : public CValidationInterface
/// Get the name of the index for display in logs.
virtual const char* GetName() const = 0;

/// Update the internal best block index as well as the prune lock.
void SetBestBlockIndex(const CBlockIndex* block);

public:
/// Destructor interrupts sync thread if running and blocks until it exits.
virtual ~BaseIndex();
Expand Down
2 changes: 2 additions & 0 deletions src/index/blockfilterindex.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class BlockFilterIndex final : public BaseIndex
/** cache of block hash to filter header, to avoid disk access when responding to getcfcheckpt. */
std::unordered_map<uint256, uint256, FilterHeaderHasher> m_headers_cache GUARDED_BY(m_cs_headers_cache);

bool AllowPrune() const override { return true; }

protected:
bool Init() override;

Expand Down
2 changes: 2 additions & 0 deletions src/index/coinstatsindex.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class CoinStatsIndex final : public BaseIndex

bool ReverseBlock(const CBlock& block, const CBlockIndex* pindex);

bool AllowPrune() const override { return true; }

protected:
bool Init() override;

Expand Down
2 changes: 2 additions & 0 deletions src/index/txindex.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class TxIndex final : public BaseIndex
private:
const std::unique_ptr<DB> m_db;

bool AllowPrune() const override { return false; }

protected:
bool WriteBlock(const CBlock& block, const CBlockIndex* pindex) override;

Expand Down
21 changes: 16 additions & 5 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,11 @@ void SetupServerArgs(ArgsManager& argsman)
-GetNumCores(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-persistmempool", strprintf("Whether to save the mempool on shutdown and load on restart (default: %u)", DEFAULT_PERSIST_MEMPOOL), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-pid=<file>", strprintf("Specify pid file. Relative paths will be prefixed by a net-specific datadir location. (default: %s)", BITCOIN_PID_FILENAME), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-prune=<n>", strprintf("Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -coinstatsindex. "
argsman.AddArg("-prune=<n>", strprintf("Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex. "
"Warning: Reverting this setting requires re-downloading the entire blockchain. "
"(default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, >=%u = automatically prune block files to stay under the specified target size in MiB)", MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-reindex", "Rebuild chain state and block index from the blk*.dat files on disk", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-reindex-chainstate", "Rebuild chain state from the currently indexed blocks. When in pruning mode or if blocks on disk might be corrupted, use full -reindex instead.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-reindex", "Rebuild chain state and block index from the blk*.dat files on disk. This will also rebuild active optional indexes.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-reindex-chainstate", "Rebuild chain state from the currently indexed blocks. When in pruning mode or if blocks on disk might be corrupted, use full -reindex instead. Deactivate all optional indexes before running this.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-settings=<file>", strprintf("Specify path to dynamic settings data file. Can be disabled with -nosettings. File is written at runtime and not meant to be edited by users (use %s instead for custom settings). Relative paths will be prefixed by datadir location. (default: %s)", BITCOIN_CONF_FILENAME, BITCOIN_SETTINGS_FILENAME), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
#if HAVE_SYSTEM
argsman.AddArg("-startupnotify=<cmd>", "Execute command on startup.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
Expand Down Expand Up @@ -858,8 +858,6 @@ bool AppInitParameterInteraction(const ArgsManager& args, bool use_syscall_sandb
if (args.GetIntArg("-prune", 0)) {
if (args.GetBoolArg("-txindex", DEFAULT_TXINDEX))
return InitError(_("Prune mode is incompatible with -txindex."));
if (args.GetBoolArg("-coinstatsindex", DEFAULT_COINSTATSINDEX))
return InitError(_("Prune mode is incompatible with -coinstatsindex."));
if (args.GetBoolArg("-reindex-chainstate", false)) {
return InitError(_("Prune mode is incompatible with -reindex-chainstate. Use full -reindex instead."));
}
Expand Down Expand Up @@ -1033,6 +1031,19 @@ bool AppInitParameterInteraction(const ArgsManager& args, bool use_syscall_sandb
return InitError(_("No proxy server specified. Use -proxy=<ip> or -proxy=<ip:port>."));
}

if (args.GetBoolArg("-reindex-chainstate", false)) {
// indexes that must be deactivated to prevent index corruption, see #24630
if (args.GetBoolArg("-coinstatsindex", DEFAULT_COINSTATSINDEX)) {
return InitError(_("-reindex-chainstate option is not compatible with -coinstatsindex. Please temporarily disable coinstatsindex while using -reindex-chainstate, or replace -reindex-chainstate with -reindex to fully rebuild all indexes."));
}
if (g_enabled_filter_types.count(BlockFilterType::BASIC)) {
return InitError(_("-reindex-chainstate option is not compatible with -blockfilterindex. Please temporarily disable blockfilterindex while using -reindex-chainstate, or replace -reindex-chainstate with -reindex to fully rebuild all indexes."));
}
if (args.GetBoolArg("-txindex", DEFAULT_TXINDEX)) {
return InitError(_("-reindex-chainstate option is not compatible with -txindex. Please temporarily disable txindex while using -reindex-chainstate, or replace -reindex-chainstate with -reindex to fully rebuild all indexes."));
}
}

#if defined(USE_SYSCALL_SANDBOX)
if (args.IsArgSet("-sandbox") && !args.IsArgNegated("-sandbox")) {
const std::string sandbox_arg{args.GetArg("-sandbox", "")};
Expand Down
4 changes: 2 additions & 2 deletions src/mapport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ static bool ProcessUpnp()
std::string strDesc = PACKAGE_NAME " " + FormatFullVersion();

do {
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), "TCP", 0, "0");
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), "TCP", nullptr, "0");

if (r != UPNPCOMMAND_SUCCESS) {
ret = false;
Expand All @@ -206,7 +206,7 @@ static bool ProcessUpnp()
} while (g_mapport_interrupt.sleep_for(PORT_MAPPING_REANNOUNCE_PERIOD));
g_mapport_interrupt.reset();

r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port.c_str(), "TCP", 0);
r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port.c_str(), "TCP", nullptr);
LogPrintf("UPNP_DeletePortMapping() returned: %d\n", r);
freeUPNPDevlist(devlist); devlist = nullptr;
FreeUPNPUrls(&urls);
Expand Down
Loading