From ff4a38a32766942ce5c4be6d6510f800a9f8e0d9 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 19 Feb 2022 13:00:45 +0200 Subject: [PATCH 01/28] build: Fix configuring depends with cmake --- depends/hosts/mingw32.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/hosts/mingw32.mk b/depends/hosts/mingw32.mk index 2f370d2b873d..48020d71af05 100644 --- a/depends/hosts/mingw32.mk +++ b/depends/hosts/mingw32.mk @@ -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 From 62e14285f95d4ecb9528813acca975640dd7c598 Mon Sep 17 00:00:00 2001 From: Martin Zumsande Date: Wed, 6 Apr 2022 17:05:32 +0200 Subject: [PATCH 02/28] doc: Add note that -reindex will rebuild optional indexes --- src/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index 86e6ec44513a..5ca5dd5401a0 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -423,7 +423,7 @@ void SetupServerArgs(ArgsManager& argsman) argsman.AddArg("-prune=", 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. " "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", "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.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-settings=", 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 From 9cc8e876e412056ed22d364538f0da3d5d71946d Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Sat, 11 Sep 2021 13:02:47 +0200 Subject: [PATCH 03/28] refactor: introduce single-separator split helper `SplitString` This helper uses spanparsing::Split internally and enables to replace all calls to boost::split where only a single separator is passed. Co-authored-by: Martin Ankerl Co-authored-by: MarcoFalke --- src/bitcoin-tx.cpp | 17 +++++------------ src/chainparams.cpp | 7 ++----- src/rest.cpp | 13 ++++--------- src/rpc/server.cpp | 6 ++---- src/rpc/util.cpp | 9 ++------- src/test/fuzz/script_assets_test_minimizer.cpp | 5 ++--- src/test/transaction_tests.cpp | 5 +---- src/torcontrol.cpp | 12 ++++++------ src/util/spanparsing.cpp | 16 ---------------- src/util/spanparsing.h | 17 ++++++++++++++++- src/util/string.h | 6 ++++++ src/wallet/rpc/backup.cpp | 5 +---- 12 files changed, 47 insertions(+), 71 deletions(-) diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 0b40626595fd..05f910e9cb3b 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -31,8 +31,6 @@ #include #include -#include - static bool fCreateBlank; static std::map registers; static const int CONTINUE_EXECUTION=-1; @@ -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 vStrInputParts; - boost::split(vStrInputParts, strInput, boost::is_any_of(":")); + std::vector vStrInputParts = SplitString(strInput, ':'); // separate TXID:VOUT in string if (vStrInputParts.size()<2) @@ -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 vStrInputParts; - boost::split(vStrInputParts, strInput, boost::is_any_of(":")); + std::vector vStrInputParts = SplitString(strInput, ':'); if (vStrInputParts.size() != 2) throw std::runtime_error("TX output missing or too many separators"); @@ -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 vStrInputParts; - boost::split(vStrInputParts, strInput, boost::is_any_of(":")); + std::vector vStrInputParts = SplitString(strInput, ':'); if (vStrInputParts.size() < 2 || vStrInputParts.size() > 3) throw std::runtime_error("TX output missing or too many separators"); @@ -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 vStrInputParts; - boost::split(vStrInputParts, strInput, boost::is_any_of(":")); + std::vector vStrInputParts = SplitString(strInput, ':'); // Check that there are enough parameters if (vStrInputParts.size()<3) @@ -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 vStrInputParts; - boost::split(vStrInputParts, strInput, boost::is_any_of(":")); + std::vector vStrInputParts = SplitString(strInput, ':'); if (vStrInputParts.size() < 2) throw std::runtime_error("TX output missing separator"); diff --git a/src/chainparams.cpp b/src/chainparams.cpp index c65a816a5f4d..7a7c72ea2570 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -10,13 +10,11 @@ #include #include // for signet block challenge hash #include