From a4ea84ed48612f68d1988c06240c15de2811604f Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Thu, 8 Dec 2022 17:01:56 +0100 Subject: [PATCH 01/11] Merge bitcoin/bitcoin#26378: refactor: Pass reference to last header, not pointer fa579f306363ed03c1138121415b67b9b36b4d53 refactor: Pass reference to last header, not pointer (MacroFake) Pull request description: It is never a nullptr, otherwise an assertion would fire in UpdatePeerStateForReceivedHeaders. Passing a reference makes the code easier to read and less brittle. ACKs for top commit: john-moffett: ACK fa579f3 aureleoules: ACK fa579f306363ed03c1138121415b67b9b36b4d53 Tree-SHA512: 9725195663a31df57ae46bb7b11211cc4963a8f3d100f60332bfd4a3f3327a73ac978b3172e3007793cfc508dfc7c3a81aab57a275a6963a5ab662ce85743fd0 --- src/net_processing.cpp | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 851848a60d5d..748922c8433c 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -773,9 +773,9 @@ class PeerManagerImpl final : public PeerManager bool MaybeSendGetHeaders(CNode& pfrom, const std::string& msg_type, const CBlockLocator& locator, Peer& peer) EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex); /** Potentially fetch blocks from this peer upon receipt of a new headers tip */ - void HeadersDirectFetchBlocks(CNode& pfrom, const Peer& peer, const CBlockIndex* pindexLast); + void HeadersDirectFetchBlocks(CNode& pfrom, const Peer& peer, const CBlockIndex& last_header); /** Update peer state based on received headers message */ - void UpdatePeerStateForReceivedHeaders(CNode& pfrom, const CBlockIndex *pindexLast, bool received_new_header, bool may_have_more_headers); + void UpdatePeerStateForReceivedHeaders(CNode& pfrom, const CBlockIndex& last_header, bool received_new_header, bool may_have_more_headers); void SendBlockTransactions(CNode& pfrom, const CBlock& block, const BlockTransactionsRequest& req) EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex); @@ -3136,22 +3136,21 @@ bool PeerManagerImpl::MaybeSendGetHeaders(CNode& pfrom, const std::string& msg_t } /* - * Given a new headers tip ending in pindexLast, potentially request blocks towards that tip. + * Given a new headers tip ending in last_header, potentially request blocks towards that tip. * We require that the given tip have at least as much work as our tip, and for * our current tip to be "close to synced" (see CanDirectFetch()). */ -void PeerManagerImpl::HeadersDirectFetchBlocks(CNode& pfrom, const Peer& peer, const CBlockIndex* pindexLast) +void PeerManagerImpl::HeadersDirectFetchBlocks(CNode& pfrom, const Peer& peer, const CBlockIndex& last_header) { const CNetMsgMaker msgMaker(pfrom.GetCommonVersion()); LOCK(cs_main); CNodeState *nodestate = State(pfrom.GetId()); - if (CanDirectFetch() && pindexLast->IsValid(BLOCK_VALID_TREE) && m_chainman.ActiveChain().Tip()->nChainWork <= pindexLast->nChainWork) { - + if (CanDirectFetch() && last_header.IsValid(BLOCK_VALID_TREE) && m_chainman.ActiveChain().Tip()->nChainWork <= last_header.nChainWork) { std::vector vToFetch; - const CBlockIndex *pindexWalk = pindexLast; - // Calculate all the blocks we'd need to switch to pindexLast, up to a limit. + const CBlockIndex* pindexWalk{&last_header}; + // Calculate all the blocks we'd need to switch to last_header, up to a limit. while (pindexWalk && !m_chainman.ActiveChain().Contains(pindexWalk) && vToFetch.size() <= MAX_BLOCKS_IN_TRANSIT_PER_PEER) { if (!(pindexWalk->nStatus & BLOCK_HAVE_DATA) && !IsBlockRequested(pindexWalk->GetBlockHash())) { @@ -3166,8 +3165,8 @@ void PeerManagerImpl::HeadersDirectFetchBlocks(CNode& pfrom, const Peer& peer, c // direct fetch and rely on parallel download instead. if (!m_chainman.ActiveChain().Contains(pindexWalk)) { LogPrint(BCLog::NET, "Large reorg, won't direct fetch to %s (%d)\n", - pindexLast->GetBlockHash().ToString(), - pindexLast->nHeight); + last_header.GetBlockHash().ToString(), + last_header.nHeight); } else { std::vector vGetData; // Download as much as possible, from earliest to latest. @@ -3183,14 +3182,15 @@ void PeerManagerImpl::HeadersDirectFetchBlocks(CNode& pfrom, const Peer& peer, c } if (vGetData.size() > 1) { LogPrint(BCLog::NET, "Downloading blocks toward %s (%d) via headers direct fetch\n", - pindexLast->GetBlockHash().ToString(), pindexLast->nHeight); + last_header.GetBlockHash().ToString(), + last_header.nHeight); } if (vGetData.size() > 0) { if (!m_ignore_incoming_txs && nodestate->m_provides_cmpctblocks && vGetData.size() == 1 && mapBlocksInFlight.size() == 1 && - pindexLast->pprev->IsValid(BLOCK_VALID_CHAIN)) { + last_header.pprev->IsValid(BLOCK_VALID_CHAIN)) { // In any case, we want to download using a compact block, not a regular one vGetData[0] = CInv(MSG_CMPCT_BLOCK, vGetData[0].hash); } @@ -3201,12 +3201,12 @@ void PeerManagerImpl::HeadersDirectFetchBlocks(CNode& pfrom, const Peer& peer, c } /** - * Given receipt of headers from a peer ending in pindexLast, along with + * Given receipt of headers from a peer ending in last_header, along with * whether that header was new and whether the headers message was full, * update the state we keep for the peer. */ void PeerManagerImpl::UpdatePeerStateForReceivedHeaders(CNode& pfrom, - const CBlockIndex *pindexLast, bool received_new_header, bool may_have_more_headers) + const CBlockIndex& last_header, bool received_new_header, bool may_have_more_headers) { LOCK(cs_main); CNodeState *nodestate = State(pfrom.GetId()); @@ -3215,14 +3215,13 @@ void PeerManagerImpl::UpdatePeerStateForReceivedHeaders(CNode& pfrom, } nodestate->nUnconnectingHeaders = 0; - assert(pindexLast); - UpdateBlockAvailability(pfrom.GetId(), pindexLast->GetBlockHash()); + UpdateBlockAvailability(pfrom.GetId(), last_header.GetBlockHash()); // From here, pindexBestKnownBlock should be guaranteed to be non-null, // because it is set in UpdateBlockAvailability. Some nullptr checks // are still present, however, as belt-and-suspenders. - if (received_new_header && pindexLast->nChainWork > m_chainman.ActiveChain().Tip()->nChainWork) { + if (received_new_header && last_header.nChainWork > m_chainman.ActiveChain().Tip()->nChainWork) { nodestate->m_last_block_announcement = GetTime(); } @@ -3319,10 +3318,10 @@ void PeerManagerImpl::ProcessHeadersMessage(CNode& pfrom, Peer& peer, } } - UpdatePeerStateForReceivedHeaders(pfrom, pindexLast, received_new_header, nCount == GetHeadersLimit(pfrom, uses_compressed)); + UpdatePeerStateForReceivedHeaders(pfrom, *pindexLast, received_new_header, nCount == GetHeadersLimit(pfrom, uses_compressed)); // Consider immediately downloading blocks. - HeadersDirectFetchBlocks(pfrom, peer, pindexLast); + HeadersDirectFetchBlocks(pfrom, peer, *pindexLast); return; } From be97c0f0082fb9a02c2a53f42bc5fac016504de4 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Sat, 17 Dec 2022 11:46:07 +0100 Subject: [PATCH 02/11] Merge bitcoin/bitcoin#26120: refactor: Make bitcoin-util grind_task tsan friendly fafcc9439838b3f084fc054b91bca4b50ee62df5 Make bitcoin-util grind_task tsan friendly (MacroFake) Pull request description: While there is no issue with the current code, `libtsan-12.2.1` on my machine does not seem to like it. This is understandable, because the nonce isn't protected by a mutex that the sanitizer can see (only by an atomic, which achieves the same). Fix this by guarding the nonce by the existing atomic bool, which tsan seems to understand. ACKs for top commit: ajtowns: ACK fafcc9439838b3f084fc054b91bca4b50ee62df5 hebasto: ACK fafcc9439838b3f084fc054b91bca4b50ee62df5, I have reviewed the code and it looks OK, I agree it can be merged. Confirming that initial bug has been fixed. Tree-SHA512: 4e67fab5833ec7d91678b85a300368892ee9f7cd89a52cc5e15a7df65b2da813b24eaffd8362d0d8a3c8951e024041d69ebddf25101b11d0a1a62c1208ddc9a5 --- src/bitcoin-util.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bitcoin-util.cpp b/src/bitcoin-util.cpp index 41982a128457..15ed5f3a558f 100644 --- a/src/bitcoin-util.cpp +++ b/src/bitcoin-util.cpp @@ -77,13 +77,12 @@ static int AppInitUtil(ArgsManager& args, int argc, char* argv[]) return CONTINUE_EXECUTION; } -static void grind_task(uint32_t nBits, CBlockHeader& header_orig, uint32_t offset, uint32_t step, std::atomic& found) +static void grind_task(uint32_t nBits, CBlockHeader header, uint32_t offset, uint32_t step, std::atomic& found, uint32_t& proposed_nonce) { arith_uint256 target; bool neg, over; target.SetCompact(nBits, &neg, &over); if (target == 0 || neg || over) return; - CBlockHeader header = header_orig; // working copy header.nNonce = offset; uint32_t finish = std::numeric_limits::max() - step; @@ -94,7 +93,7 @@ static void grind_task(uint32_t nBits, CBlockHeader& header_orig, uint32_t offse do { if (UintToArith256(header.GetHash()) <= target) { if (!found.exchange(true)) { - header_orig.nNonce = header.nNonce; + proposed_nonce = header.nNonce; } return; } @@ -118,16 +117,19 @@ static int Grind(const std::vector& args, std::string& strPrint) uint32_t nBits = header.nBits; std::atomic found{false}; + uint32_t proposed_nonce{}; std::vector threads; int n_tasks = std::max(1u, std::thread::hardware_concurrency()); for (int i = 0; i < n_tasks; ++i) { - threads.emplace_back( grind_task, nBits, std::ref(header), i, n_tasks, std::ref(found) ); + threads.emplace_back(grind_task, nBits, header, i, n_tasks, std::ref(found), std::ref(proposed_nonce)); } for (auto& t : threads) { t.join(); } - if (!found) { + if (found) { + header.nNonce = proposed_nonce; + } else { strPrint = "Could not satisfy difficulty target"; return EXIT_FAILURE; } From 25acdc3ba65c885637f9809adbb52089d003dcf0 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Tue, 3 Jan 2023 12:53:23 -0500 Subject: [PATCH 03/11] Merge bitcoin/bitcoin#26192: rpc: Improve error when wallet is already loaded MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 04609284ad5e0b72651f2d4b43263461ada40816 rpc: Improve error when wallet is already loaded (Aurèle Oulès) Pull request description: Currently, trying to load a descriptor (sqlite) wallet that is already loaded throws the following error: > error code: -4 > error message: > Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of Bitcoin Core? I don't think it is very clear what it means for a user. While a legacy wallet would throw: > error code: -35 > error message: > Wallet file verification failed. Refusing to load database. Data file '/home/user/.bitcoin/signet/wallets/test_wallet/wallet.dat' is already loaded. This PR changes the error message for both types of wallet to: > error code: -35 > error message: > Wallet file verification failed. Wallet "test_wallet" is already loaded. ACKs for top commit: achow101: ACK 04609284ad5e0b72651f2d4b43263461ada40816 hernanmarino: ACK 0460928 theStack: Tested ACK 04609284ad5e0b72651f2d4b43263461ada40816 Tree-SHA512: a8f3d5133bfaef7417a6c05d160910ea08f32ac62bfdf7f5ec305ff5b62e9113b55f385abab4d5a4ad711aabcb1eb7ef746eb41f841b196e8fb5393ab3ccc01e --- src/wallet/rpc/wallet.cpp | 8 ++++++++ test/functional/wallet_multiwallet.py | 7 ++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/wallet/rpc/wallet.cpp b/src/wallet/rpc/wallet.cpp index 7fc43fa5ef2a..635bd0c61686 100644 --- a/src/wallet/rpc/wallet.cpp +++ b/src/wallet/rpc/wallet.cpp @@ -534,6 +534,14 @@ static RPCHelpMan loadwallet() bilingual_str error; std::vector warnings; std::optional load_on_start = request.params[1].isNull() ? std::nullopt : std::optional(request.params[1].get_bool()); + + { + LOCK(context.wallets_mutex); + if (std::any_of(context.wallets.begin(), context.wallets.end(), [&name](const auto& wallet) { return wallet->GetName() == name; })) { + throw JSONRPCError(RPC_WALLET_ALREADY_LOADED, "Wallet \"" + name + "\" is already loaded."); + } + } + std::shared_ptr const wallet = LoadWallet(context, name, load_on_start, options, status, error, warnings); HandleWalletError(wallet, status, error); diff --git a/test/functional/wallet_multiwallet.py b/test/functional/wallet_multiwallet.py index 541751768d63..000c67573ed2 100755 --- a/test/functional/wallet_multiwallet.py +++ b/test/functional/wallet_multiwallet.py @@ -300,15 +300,12 @@ def wallet_file(name): # Fail to load duplicate wallets path = os.path.join(self.options.tmpdir, "node0", self.chain, "wallets", "w1", self.wallet_data_filename) - if self.options.descriptors: - assert_raises_rpc_error(-4, f"Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of {self.config['environment']['PACKAGE_NAME']}?", self.nodes[0].loadwallet, wallet_names[0]) - else: - assert_raises_rpc_error(-35, "Wallet file verification failed. Refusing to load database. Data file '{}' is already loaded.".format(path), self.nodes[0].loadwallet, wallet_names[0]) + assert_raises_rpc_error(-35, "Wallet \"w1\" is already loaded.", self.nodes[0].loadwallet, wallet_names[0]) # Fail to load duplicate wallets by different ways (directory and filepath) if not self.options.descriptors: path = os.path.join(self.options.tmpdir, "node0", self.chain, "wallets", self.wallet_data_filename) - assert_raises_rpc_error(-35, "Wallet file verification failed. Refusing to load database. Data file '{}' is already loaded.".format(path), self.nodes[0].loadwallet, self.wallet_data_filename) + assert_raises_rpc_error(-35, "Wallet \"w1\" is already loaded.", self.nodes[0].loadwallet, self.wallet_data_filename) # Only BDB doesn't open duplicate wallet files. SQLite does not have this limitation. While this may be desired in the future, it is not necessary # Fail to load if one wallet is a copy of another From 9ca403087e4057c2e6daa4d1a01d4f9a2b161a67 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Tue, 6 Jan 2026 16:17:20 +0700 Subject: [PATCH 04/11] fix: re-resolve conflicts for previous backports in wallet_multiwallet.py after bitcoin/bitcoin#26192 Done to make it unify with Bitcoin Core, re-ordered line, removed duplicates and out-dated lines Without these changes wallet_multiwallet.py fails with error: AssertionError: Expected substring not found in error message: substring: 'Wallet "w1" is already loaded.' error message: 'Wallet file verification failed. Refusing to load database. Data file 'wallet_multiwallet_213/node0/regtest/wallets/wallet.dat' is already loaded.'. --- test/functional/wallet_multiwallet.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/test/functional/wallet_multiwallet.py b/test/functional/wallet_multiwallet.py index 000c67573ed2..bc01efbe5278 100755 --- a/test/functional/wallet_multiwallet.py +++ b/test/functional/wallet_multiwallet.py @@ -299,13 +299,12 @@ def wallet_file(name): assert_raises_rpc_error(-18, "Wallet file verification failed. Failed to load database path '{}'. Path does not exist.".format(path), self.nodes[0].loadwallet, 'wallets') # Fail to load duplicate wallets - path = os.path.join(self.options.tmpdir, "node0", self.chain, "wallets", "w1", self.wallet_data_filename) assert_raises_rpc_error(-35, "Wallet \"w1\" is already loaded.", self.nodes[0].loadwallet, wallet_names[0]) - - # Fail to load duplicate wallets by different ways (directory and filepath) if not self.options.descriptors: - path = os.path.join(self.options.tmpdir, "node0", self.chain, "wallets", self.wallet_data_filename) - assert_raises_rpc_error(-35, "Wallet \"w1\" is already loaded.", self.nodes[0].loadwallet, self.wallet_data_filename) + # This tests the default wallet that BDB makes, so SQLite wallet doesn't need to test this + # Fail to load duplicate wallets by different ways (directory and filepath) + path = os.path.join(self.options.tmpdir, "node0", self.chain, "wallets", "wallet.dat") + assert_raises_rpc_error(-35, "Wallet file verification failed. Refusing to load database. Data file '{}' is already loaded.".format(path), self.nodes[0].loadwallet, 'wallet.dat') # Only BDB doesn't open duplicate wallet files. SQLite does not have this limitation. While this may be desired in the future, it is not necessary # Fail to load if one wallet is a copy of another @@ -317,6 +316,11 @@ def wallet_file(name): # Fail to load if wallet file is a symlink assert_raises_rpc_error(-4, "Wallet file verification failed. Invalid -wallet path 'w8_symlink'", self.nodes[0].loadwallet, 'w8_symlink') + # Fail to load if a directory is specified that doesn't contain a wallet + os.mkdir(wallet_dir('empty_wallet_dir')) + path = os.path.join(self.options.tmpdir, "node0", self.chain, "wallets", "empty_wallet_dir") + assert_raises_rpc_error(-18, "Wallet file verification failed. Failed to load database path '{}'. Data is not in recognized format.".format(path), self.nodes[0].loadwallet, 'empty_wallet_dir') + self.log.info("Test dynamic wallet creation.") # Fail to create a wallet if it already exists. @@ -342,11 +346,6 @@ def wallet_file(name): assert new_wallet_name in self.nodes[0].listwallets() - # Fail to load if a directory is specified that doesn't contain a wallet - os.mkdir(wallet_dir('empty_wallet_dir')) - path = os.path.join(self.options.tmpdir, "node0", self.chain, "wallets", "empty_wallet_dir") - assert_raises_rpc_error(-18, "Wallet file verification failed. Failed to load database path '{}'. Data is not in recognized format.".format(path), self.nodes[0].loadwallet, 'empty_wallet_dir') - self.log.info("Test dynamic wallet unloading") # Test `unloadwallet` errors From a097e7fb13ff113b5f4d657f8bd7672ff81cb0d6 Mon Sep 17 00:00:00 2001 From: fanquake Date: Wed, 4 Jan 2023 11:40:33 +0000 Subject: [PATCH 05/11] Merge bitcoin/bitcoin#26771: doc: Correct linked Microsoft URLs f84e445dee5f4c5d65cb702958701ff7b38ebdce doc: Correct linked Microsoft URLs (Suriyaa Sundararuban) Pull request description: Update Microsoft-related links. Top commit has no ACKs. Tree-SHA512: 40c7b25a96772259fb04da1946d52f6aac9562262aef472ae75807bfbd246de47d72118140a12f7553037b94b89f95d69dea6ce30e611ac3d71a32d102355150 --- doc/build-windows.md | 6 +++--- doc/fuzzing.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/build-windows.md b/doc/build-windows.md index 873d8d67af62..ec2fe1dbed07 100644 --- a/doc/build-windows.md +++ b/doc/build-windows.md @@ -6,7 +6,7 @@ Below are some notes on how to build Dash Core for Windows. The options known to work for building Dash Core on Windows are: * On Linux, using the [Mingw-w64](https://www.mingw-w64.org/) cross compiler tool chain. -* On Windows, using [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/windows/wsl/about) and Mingw-w64. +* On Windows, using [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/about) and Mingw-w64. Other options which may work, but which have not been extensively tested are (please contribute instructions): @@ -18,7 +18,7 @@ package meets the minimum required `g++` version specified in [dependencies.md]( Installing Windows Subsystem for Linux --------------------------------------- -Follow the upstream installation instructions, available [here](https://docs.microsoft.com/windows/wsl/install-win10). +Follow the upstream installation instructions, available [here](https://learn.microsoft.com/en-us/windows/wsl/install). Cross-compilation ------------------- @@ -34,7 +34,7 @@ Note that for WSL the Dash Core source path MUST be somewhere in the default mou example /usr/src/dash, AND not under /mnt/d/. If this is not the case the dependency autoconf scripts will fail. This means you cannot use a directory that is located directly on the host Windows file system to perform the build. -Additional WSL Note: WSL support for [launching Win32 applications](https://docs.microsoft.com/en-us/archive/blogs/wsl/windows-and-ubuntu-interoperability#launching-win32-applications-from-within-wsl) +Additional WSL Note: WSL support for [launching Win32 applications](https://learn.microsoft.com/en-us/archive/blogs/wsl/windows-and-ubuntu-interoperability#launching-win32-applications-from-within-wsl) results in `Autoconf` configure scripts being able to execute Windows Portable Executable files. This can cause unexpected behaviour during the build, such as Win32 error dialogs for missing libraries. The recommended approach is to temporarily disable WSL support for Win32 applications. diff --git a/doc/fuzzing.md b/doc/fuzzing.md index c8a121341c5b..2bd7461889f3 100644 --- a/doc/fuzzing.md +++ b/doc/fuzzing.md @@ -279,8 +279,8 @@ $ sudo apt-get install libtool libtool-bin wget automake autoconf bison gdb ``` At this point, you must install the .NET core. The process differs, depending on your Linux distribution. -See [this link](https://docs.microsoft.com/en-us/dotnet/core/install/linux) for details. -On ubuntu 20.04, the following should work: +See [this link](https://learn.microsoft.com/en-us/dotnet/core/install/linux) for details. +On Ubuntu 20.04, the following should work: ```sh $ wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb From f29b64ec6234ae07445588b26d05b76711018b8a Mon Sep 17 00:00:00 2001 From: glozow Date: Wed, 4 Jan 2023 17:47:52 +0000 Subject: [PATCH 06/11] Merge bitcoin/bitcoin#26752: wallet: Remove `mempool_sequence` from interface methods 55696a0ac30bcfbd555f71cbc8eac23b725f7dcf wallet: remove `mempool_sequence` from `transactionRemovedFromMempool` (w0xlt) bf19069c53501231a2f3ba59afa067913ec4d3b2 wallet: remove `mempool_sequence` from `transactionAddedToMempool` (w0xlt) Pull request description: This PR removes `mempool_sequence` from `transactionRemovedFromMempool` and `transactionAddedToMempool`. `mempool_sequence` is not used in these methods, only in ZMQ notifications. ACKs for top commit: instagibbs: ACK https://github.com/bitcoin/bitcoin/pull/26752/commits/55696a0ac30bcfbd555f71cbc8eac23b725f7dcf Tree-SHA512: 621e89230bcb6edfed83e2758601a2b093822fc2dc4e9bfb00487e340f2bc4c5ac3bf6df3ca00b7fe55bb3df15858820f2bf698f403d2e48b915dd9eb47b63e0 --- src/interfaces/chain.h | 4 ++-- src/node/interfaces.cpp | 6 +++--- src/wallet/test/wallet_tests.cpp | 4 ++-- src/wallet/wallet.cpp | 6 +++--- src/wallet/wallet.h | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h index 19ebf9d6f3bf..34f89047d2ad 100644 --- a/src/interfaces/chain.h +++ b/src/interfaces/chain.h @@ -261,8 +261,8 @@ class Chain { public: virtual ~Notifications() {} - virtual void transactionAddedToMempool(const CTransactionRef& tx, int64_t nAcceptTime, uint64_t mempool_sequence) {} - virtual void transactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason, uint64_t mempool_sequence) {} + virtual void transactionAddedToMempool(const CTransactionRef& tx, int64_t nAcceptTime) {} + virtual void transactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason) {} virtual void blockConnected(const CBlock& block, int height) {} virtual void blockDisconnected(const CBlock& block, int height) {} virtual void updatedBlockTip() {} diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index d3e6283eb5a9..7fd65de80a9f 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -909,11 +909,11 @@ class NotificationsProxy : public CValidationInterface virtual ~NotificationsProxy() = default; void TransactionAddedToMempool(const CTransactionRef& tx, int64_t nAcceptTime, uint64_t mempool_sequence) override { - m_notifications->transactionAddedToMempool(tx, nAcceptTime, mempool_sequence); + m_notifications->transactionAddedToMempool(tx, nAcceptTime); } void TransactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason, uint64_t mempool_sequence) override { - m_notifications->transactionRemovedFromMempool(tx, reason, mempool_sequence); + m_notifications->transactionRemovedFromMempool(tx, reason); } void BlockConnected(const std::shared_ptr& block, const CBlockIndex* index) override { @@ -1303,7 +1303,7 @@ class ChainImpl : public Chain if (!m_node.mempool) return; LOCK2(::cs_main, m_node.mempool->cs); for (const CTxMemPoolEntry& entry : m_node.mempool->mapTx) { - notifications.transactionAddedToMempool(entry.GetSharedTx(), /* nAcceptTime = */ 0, /* mempool_sequence = */ 0); + notifications.transactionAddedToMempool(entry.GetSharedTx(), /*nAcceptTime=*/0); } } bool hasAssumedValidChain() override diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp index cf398e4df3fd..4e3885b845e2 100644 --- a/src/wallet/test/wallet_tests.cpp +++ b/src/wallet/test/wallet_tests.cpp @@ -1556,7 +1556,7 @@ BOOST_FIXTURE_TEST_CASE(wallet_sync_tx_invalid_state_test, TestChain100Setup) mtx.vin.clear(); mtx.vin.push_back(CTxIn(tx_id_to_spend, 0)); - wallet.transactionAddedToMempool(MakeTransactionRef(mtx), 0, 0); + wallet.transactionAddedToMempool(MakeTransactionRef(mtx), 0); const uint256& good_tx_id = mtx.GetHash(); { @@ -1577,7 +1577,7 @@ BOOST_FIXTURE_TEST_CASE(wallet_sync_tx_invalid_state_test, TestChain100Setup) static_cast(wallet.GetDatabase()).m_pass = false; mtx.vin.clear(); mtx.vin.push_back(CTxIn(good_tx_id, 0)); - BOOST_CHECK_EXCEPTION(wallet.transactionAddedToMempool(MakeTransactionRef(mtx), 0, 0), + BOOST_CHECK_EXCEPTION(wallet.transactionAddedToMempool(MakeTransactionRef(mtx), 0), std::runtime_error, HasReason("DB error adding transaction to wallet, write failed")); } diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 3132c36766d6..c6fcc256a4cc 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1329,7 +1329,7 @@ void CWallet::SyncTransaction(const CTransactionRef& ptx, const SyncTxState& sta fAnonymizableTallyCachedNonDenom = false; } -void CWallet::transactionAddedToMempool(const CTransactionRef& tx, int64_t nAcceptTime, uint64_t mempool_sequence) { +void CWallet::transactionAddedToMempool(const CTransactionRef& tx, int64_t nAcceptTime) { LOCK(cs_wallet); WalletBatch batch(GetDatabase()); SyncTransaction(tx, TxStateInMempool{}, batch); @@ -1340,7 +1340,7 @@ void CWallet::transactionAddedToMempool(const CTransactionRef& tx, int64_t nAcce } } -void CWallet::transactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason, uint64_t mempool_sequence) { +void CWallet::transactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason) { if (reason != MemPoolRemovalReason::CONFLICT) { LOCK(cs_wallet); auto it = mapWallet.find(tx->GetHash()); @@ -1391,7 +1391,7 @@ void CWallet::blockConnected(const CBlock& block, int height) WalletBatch batch(GetDatabase()); for (size_t index = 0; index < block.vtx.size(); index++) { SyncTransaction(block.vtx[index], TxStateConfirmed{block_hash, height, static_cast(index)}, batch); - transactionRemovedFromMempool(block.vtx[index], MemPoolRemovalReason::BLOCK, 0 /* mempool_sequence */); + transactionRemovedFromMempool(block.vtx[index], MemPoolRemovalReason::BLOCK); } // reset cache to make sure no longer immature coins are included diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 0ac939954c42..cc53f9028265 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -643,7 +643,7 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati */ CWalletTx* AddToWallet(CTransactionRef tx, const TxState& state, const UpdateWalletTxFn& update_wtx=nullptr, bool fFlushOnClose=true, bool rescanning_old_block = false); bool LoadToWallet(const uint256& hash, const UpdateWalletTxFn& fill_wtx) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); - void transactionAddedToMempool(const CTransactionRef& tx, int64_t nAcceptTime, uint64_t mempool_sequence) override; + void transactionAddedToMempool(const CTransactionRef& tx, int64_t nAcceptTime) override; void blockConnected(const CBlock& block, int height) override; void blockDisconnected(const CBlock& block, int height) override; void updatedBlockTip() override; @@ -665,7 +665,7 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati uint256 last_failed_block; }; ScanResult ScanForWalletTransactions(const uint256& start_block, int start_height, std::optional max_height, const WalletRescanReserver& reserver, bool fUpdate, const bool save_progress); - void transactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason, uint64_t mempool_sequence) override; + void transactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason) override; void ReacceptWalletTransactions() EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); void ResendWalletTransactions(); From 1964560a32ecfdf966dafaf9cb5d2de86e86065c Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Wed, 11 Jan 2023 16:18:28 +0100 Subject: [PATCH 07/11] Merge bitcoin/bitcoin#26758: refactor: Add `performance-no-automatic-move` clang-tidy check 9567bfeab95cc0932073641dd162903850987d43 clang-tidy: Add `performance-no-automatic-move` check (Hennadii Stepanov) Pull request description: Split from bitcoin/bitcoin#26642 as [requested](https://github.com/bitcoin/bitcoin/pull/26642#discussion_r1054673201). For the problem description see https://clang.llvm.org/extra/clang-tidy/checks/performance/no-automatic-move.html. The following types are affected: - `std::pair` - `std::vector` - `UniValue`, also see bitcoin/bitcoin#25429 - `QColor` - `CBlock` - `MempoolAcceptResult` - `std::shared_ptr` - `std::optional` - `CTransactionRef`, which is `std::shared_ptr` ACKs for top commit: andrewtoth: ACK 9567bfeab95cc0932073641dd162903850987d43 aureleoules: ACK 9567bfeab95cc0932073641dd162903850987d43 Tree-SHA512: 9b6a5d539205b41d2c86402d384318ed2e1d89e66333ebd200a48fd7df3ce6f6c60a3e989eda5cc503fb34b8d82526f95e56776e1af51e63b49e3a1fef72dbcb --- src/.clang-tidy | 2 ++ src/addrman.cpp | 6 +++--- src/bitcoin-cli.cpp | 2 +- src/instantsend/instantsend.cpp | 2 +- src/rpc/util.cpp | 2 +- src/test/fuzz/tx_pool.cpp | 2 +- src/test/fuzz/txorphan.cpp | 2 +- src/test/util/setup_common.cpp | 2 +- src/validation.cpp | 4 ++-- src/wallet/rpc/util.cpp | 2 +- src/wallet/test/coinselector_tests.cpp | 2 +- src/wallet/wallet.cpp | 6 +++--- 12 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/.clang-tidy b/src/.clang-tidy index 76978140ecd7..9e518d1fbf26 100644 --- a/src/.clang-tidy +++ b/src/.clang-tidy @@ -7,6 +7,7 @@ modernize-use-default-member-init, modernize-use-nullptr, performance-for-range-copy, performance-move-const-arg, +performance-no-automatic-move, performance-unnecessary-copy-initialization, readability-const-return-type, readability-redundant-declaration, @@ -19,6 +20,7 @@ misc-unused-using-decls, modernize-use-default-member-init, modernize-use-nullptr, performance-move-const-arg, +performance-no-automatic-move, performance-unnecessary-copy-initialization, readability-redundant-declaration, readability-redundant-string-init, diff --git a/src/addrman.cpp b/src/addrman.cpp index 7959ec2b74ca..e353d457264e 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -1195,7 +1195,7 @@ std::pair AddrManImpl::SelectTriedCollision() { LOCK(cs); Check(); - const auto ret = SelectTriedCollision_(); + auto ret = SelectTriedCollision_(); Check(); return ret; } @@ -1204,7 +1204,7 @@ std::pair AddrManImpl::Select(bool new_only, std::optiona { LOCK(cs); Check(); - const auto addrRet = Select_(new_only, network); + auto addrRet = Select_(new_only, network); Check(); return addrRet; } @@ -1213,7 +1213,7 @@ std::vector AddrManImpl::GetAddr(size_t max_addresses, size_t max_pct, { LOCK(cs); Check(); - const auto addresses = GetAddr_(max_addresses, max_pct, network); + auto addresses = GetAddr_(max_addresses, max_pct, network); Check(); return addresses; } diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index c8018e7b9aa7..fe6bbb6a9ecb 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -852,7 +852,7 @@ static UniValue CallRPC(BaseRequestHandler* rh, const std::string& strMethod, co UniValue valReply(UniValue::VSTR); if (!valReply.read(response.body)) throw std::runtime_error("couldn't parse reply from server"); - const UniValue reply = rh->ProcessReply(valReply); + UniValue reply = rh->ProcessReply(valReply); if (reply.empty()) throw std::runtime_error("expected reply to have result, error and id properties"); diff --git a/src/instantsend/instantsend.cpp b/src/instantsend/instantsend.cpp index 495eefd68119..62a1278413b1 100644 --- a/src/instantsend/instantsend.cpp +++ b/src/instantsend/instantsend.cpp @@ -144,7 +144,7 @@ std::variant CInstantSendManager::Proc } uint256 hashBlock{}; - const auto tx = GetTransaction(nullptr, &mempool, islock->txid, Params().GetConsensus(), hashBlock); + auto tx = GetTransaction(nullptr, &mempool, islock->txid, Params().GetConsensus(), hashBlock); const bool found_transaction{tx != nullptr}; // we ignore failure here as we must be able to propagate the lock even if we don't have the TX locally std::optional minedHeight = GetBlockHeight(hashBlock); diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp index 9aae2d7e0c96..af14af07e2b3 100644 --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -533,7 +533,7 @@ UniValue RPCHelpMan::HandleRequest(const JSONRPCRequest& request) const if (request.mode == JSONRPCRequest::GET_HELP || !IsValidNumArgs(request.params.size())) { throw std::runtime_error(ToString()); } - const UniValue ret = m_fun(*this, request); + UniValue ret = m_fun(*this, request); if (gArgs.GetBoolArg("-rpcdoccheck", DEFAULT_RPC_DOC_CHECK)) { CHECK_NONFATAL(std::any_of(m_results.m_results.begin(), m_results.m_results.end(), [&ret](const RPCResult& res) { return res.MatchesType(ret); })); } diff --git a/src/test/fuzz/tx_pool.cpp b/src/test/fuzz/tx_pool.cpp index 86395c08c313..aa8185cc5205 100644 --- a/src/test/fuzz/tx_pool.cpp +++ b/src/test/fuzz/tx_pool.cpp @@ -201,7 +201,7 @@ FUZZ_TARGET(tx_pool_standard, .init = initialize_tx_pool) for (int i = 0; i < num_out; ++i) { tx_mut.vout.emplace_back(amount_out, CScript() << OP_RETURN); } - const auto tx = MakeTransactionRef(tx_mut); + auto tx = MakeTransactionRef(tx_mut); // Restore previously removed outpoints for (const auto& in : tx->vin) { Assert(outpoints_rbf.insert(in.prevout).second); diff --git a/src/test/fuzz/txorphan.cpp b/src/test/fuzz/txorphan.cpp index f4d12c41fce4..17709d9f72f4 100644 --- a/src/test/fuzz/txorphan.cpp +++ b/src/test/fuzz/txorphan.cpp @@ -73,7 +73,7 @@ FUZZ_TARGET(txorphan, .init = initialize_orphanage) for (auto& in : tx_mut.vin) { outpoints.push_back(in.prevout); } - const auto new_tx = MakeTransactionRef(tx_mut); + auto new_tx = MakeTransactionRef(tx_mut); // add newly constructed transaction to outpoints for (uint32_t i = 0; i < num_out; i++) { outpoints.emplace_back(new_tx->GetHash(), i); diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index cd999067b278..f1915033efd6 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -496,7 +496,7 @@ CBlock TestChainSetup::CreateAndProcessBlock( chainstate = &Assert(m_node.chainman)->ActiveChainstate(); } - auto block = this->CreateBlock(txns, scriptPubKey, *chainstate); + CBlock block = this->CreateBlock(txns, scriptPubKey, *chainstate); std::shared_ptr shared_pblock = std::make_shared(block); Assert(m_node.chainman)->ProcessNewBlock(shared_pblock, true, nullptr); diff --git a/src/validation.cpp b/src/validation.cpp index 95629b462cf1..a3bc8ef0fea5 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1400,7 +1400,7 @@ MempoolAcceptResult AcceptToMemoryPool(CChainState& active_chainstate, const CTr std::vector coins_to_uncache; auto args = MemPoolAccept::ATMPArgs::SingleAccept(chainparams, accept_time, bypass_limits, coins_to_uncache, test_accept); - const MempoolAcceptResult result = MemPoolAccept(pool, active_chainstate).AcceptSingleTransaction(tx, args); + MempoolAcceptResult result = MemPoolAccept(pool, active_chainstate).AcceptSingleTransaction(tx, args); if (result.m_result_type != MempoolAcceptResult::ResultType::VALID || test_accept) { if (result.m_result_type != MempoolAcceptResult::ResultType::VALID) { LogPrint(BCLog::MEMPOOL, "%s: %s %s (%s)\n", __func__, tx->GetHash().ToString(), result.m_state.GetRejectReason(), result.m_state.GetDebugMessage()); @@ -1429,7 +1429,7 @@ PackageMempoolAcceptResult ProcessNewPackage(CChainState& active_chainstate, CTx std::vector coins_to_uncache; const CChainParams& chainparams = active_chainstate.m_params; - const auto result = [&]() EXCLUSIVE_LOCKS_REQUIRED(cs_main) { + auto result = [&]() EXCLUSIVE_LOCKS_REQUIRED(cs_main) { AssertLockHeld(cs_main); if (test_accept) { auto args = MemPoolAccept::ATMPArgs::PackageTestAccept(chainparams, GetTime(), coins_to_uncache); diff --git a/src/wallet/rpc/util.cpp b/src/wallet/rpc/util.cpp index 2ab5fb449b42..6d91c1b76c06 100644 --- a/src/wallet/rpc/util.cpp +++ b/src/wallet/rpc/util.cpp @@ -75,7 +75,7 @@ std::shared_ptr GetWalletForJSONRPCRequest(const JSONRPCRequest& reques std::string wallet_name; if (GetWalletNameFromJSONRPCRequest(request, wallet_name)) { - const std::shared_ptr pwallet = GetWallet(context, wallet_name); + std::shared_ptr pwallet = GetWallet(context, wallet_name); if (!pwallet) throw JSONRPCError(RPC_WALLET_NOT_FOUND, "Requested wallet does not exist or is not loaded"); return pwallet; } diff --git a/src/wallet/test/coinselector_tests.cpp b/src/wallet/test/coinselector_tests.cpp index 2d567548412f..098c53024889 100644 --- a/src/wallet/test/coinselector_tests.cpp +++ b/src/wallet/test/coinselector_tests.cpp @@ -953,7 +953,7 @@ BOOST_AUTO_TEST_CASE(minimum_inputs_test) /*tx_noinputs_size=*/0, /*avoid_partial=*/false, }; - const auto result = SelectCoins(*wallet, available_coins, target, coin_control, coin_selection_params); + auto result = SelectCoins(*wallet, available_coins, target, coin_control, coin_selection_params); BOOST_REQUIRE(result); // Should consume only the first two coins (9 + 16) >= 25 and account correctly diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index c6fcc256a4cc..a50371e459f3 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -259,7 +259,7 @@ std::shared_ptr LoadWalletInternal(WalletContext& context, const std::s } context.chain->initMessage(_("Loading wallet…").translated); - const std::shared_ptr wallet = CWallet::Create(context, name, std::move(database), options.create_flags, error, warnings); + std::shared_ptr wallet = CWallet::Create(context, name, std::move(database), options.create_flags, error, warnings); if (!wallet) { error = Untranslated("Wallet loading failed.") + Untranslated(" ") + error; status = DatabaseStatus::FAILED_LOAD; @@ -343,7 +343,7 @@ std::shared_ptr CreateWallet(WalletContext& context, const std::string& // Make the wallet context.chain->initMessage(_("Loading wallet…").translated); - const std::shared_ptr wallet = CWallet::Create(context, name, std::move(database), wallet_creation_flags, error, warnings); + std::shared_ptr wallet = CWallet::Create(context, name, std::move(database), wallet_creation_flags, error, warnings); if (!wallet) { error = Untranslated("Wallet creation failed.") + Untranslated(" ") + error; status = DatabaseStatus::FAILED_CREATE; @@ -2927,7 +2927,7 @@ std::shared_ptr CWallet::Create(WalletContext& context, const std::stri const auto start{SteadyClock::now()}; // TODO: Can't use std::make_shared because we need a custom deleter but // should be possible to use std::allocate_shared. - const std::shared_ptr walletInstance(new CWallet(chain, coinjoin_loader, name, args, std::move(database)), ReleaseWallet); + std::shared_ptr walletInstance(new CWallet(chain, coinjoin_loader, name, args, std::move(database)), ReleaseWallet); // TODO: refactor this condition: validation of error looks like workaround if (!walletInstance->AutoBackupWallet(fs::PathFromString(walletFile), error, warnings) && !error.original.empty()) { return nullptr; From 602e549ef4be579f3049211ddc30414c6d5d8c2e Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Fri, 13 Jan 2023 09:42:03 +0100 Subject: [PATCH 08/11] Merge bitcoin/bitcoin#26867: doc: Mention restoring wallet via GUI dc9bad5192991219ab71c9046e197e2f18791d9e Change dots to an ellipsis and fix capitalization (John Moffett) 9b158ae73f9018e0d834bd6c9d9c9825e4a47540 Update to mention restoring wallet via GUI (John Moffett) Pull request description: https://github.com/bitcoin/bitcoin/commit/f9783b0f07c0c9a5dd55e1779ece5ab66519c2f2 Recently added the ability to restore wallets via the GUI, but the current wallet guide says backups must be restored via RPC. ACKs for top commit: kouloumos: ACK dc9bad5192991219ab71c9046e197e2f18791d9e jarolrod: re-ACK dc9bad5 hebasto: re-ACK dc9bad5192991219ab71c9046e197e2f18791d9e Tree-SHA512: 325a0023ef10c75073b0288f69c99f01b029b0b7b64ae91e7ef72d4ab1fa4da60fe4cd1b4528c1c0d34617122d9aee3cd9cb32aef05a25493fc01e9ec2e6cc10 --- doc/managing-wallets.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/managing-wallets.md b/doc/managing-wallets.md index 72ae306eb376..7096b6286249 100644 --- a/doc/managing-wallets.md +++ b/doc/managing-wallets.md @@ -90,7 +90,7 @@ In the RPC, the destination parameter must include the name of the file. Otherwi $ dash-cli -rpcwallet="wallet-01" backupwallet /home/node01/Backups/backup-01.dat ``` -In the GUI, the wallet is selected in the `Wallet` drop-down list in the upper right corner. If this list is not present, the wallet can be loaded in `File` ->`Open wallet` if necessary. Then, the backup can be done in `File` -> `Backup Wallet...`. +In the GUI, the wallet is selected in the `Wallet` drop-down list in the upper right corner. If this list is not present, the wallet can be loaded in `File` ->`Open Wallet` if necessary. Then, the backup can be done in `File` -> `Backup Wallet…`. This backup file can be stored on one or multiple offline devices, which must be reliable enough to work in an emergency and be malware free. Backup files can be regularly tested to avoid problems in the future. @@ -110,7 +110,7 @@ Non-HD wallets must be backed up every 1000 keys used since the previous backup, ### 1.6 Restoring the Wallet From a Backup -To restore a wallet, the `restorewallet` RPC must be used. +To restore a wallet, the `restorewallet` RPC or the `Restore Wallet` GUI menu item (`File` -> `Restore Wallet…`) must be used. ``` $ dash-cli restorewallet "restored-wallet" /home/node01/Backups/backup-01.dat @@ -122,4 +122,4 @@ After that, `getwalletinfo` can be used to check if the wallet has been fully re $ dash-cli -rpcwallet="restored-wallet" getwalletinfo ``` -The restored wallet can also be loaded in the GUI via `File` ->`Open wallet`. \ No newline at end of file +The restored wallet can also be loaded in the GUI via `File` ->`Open wallet`. From 220ab5035ccab1775922c7af1bb966777b76333f Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 13 Jan 2023 15:56:08 +0000 Subject: [PATCH 09/11] Merge bitcoin/bitcoin#26824: build: fix configuring with only bitcoin-util 0f883df7a5430d6b229a2f190fe7daab24802ebf build: fix configuring with only bitcoin-util (fanquake) Pull request description: Fixes the issue presented in #25037 in a single (easily backportable) diff, with no additional refactoring/changes. Can be tested with: ```bash ./configure \ --disable-tests \ --disable-bench \ --without-libs \ --without-daemon \ --without-gui \ --disable-fuzz-binary \ --without-utils \ --enable-util-util ``` ACKs for top commit: TheCharlatan: tACK 0f883df7a5430d6b229a2f190fe7daab24802ebf hebasto: ACK 0f883df7a5430d6b229a2f190fe7daab24802ebf, tested on Ubuntu 22.04. Tree-SHA512: 3682712405c360852c4edd90c171e21302154bf8789252c64083974a5c873cf04d97e8721c7916d5b2dafa6acd2b8dc32deecf550e90e03bcbbabbbbf75ce959 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3798c0222614..a4d68750b89f 100644 --- a/configure.ac +++ b/configure.ac @@ -1586,7 +1586,7 @@ if test "$use_natpmp" != "no"; then CPPFLAGS="$TEMP_CPPFLAGS" fi -if test "$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench$enable_fuzz_binary" = "nononononononono"; then +if test "$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoin_util$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench$enable_fuzz_binary" = "nonononononononono"; then use_boost=no else use_boost=yes From 369830677413b3656144d38faf5ea43bd57b5316 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Wed, 18 Jan 2023 09:11:56 +0100 Subject: [PATCH 10/11] Merge bitcoin/bitcoin#26810: doc: remove nonexistent files from copyright 4bb91be1245666ff62b6a1e683c6ba5a5651b544 debian: remove nonexistent files from copyright (fanquake) Pull request description: The removed files were dropped during a secp256k1 subtree update. Top commit has no ACKs. Tree-SHA512: 19ef1cf76908b5468265cc25b76abf8cf3a1dd0d5f7390f9cf4c5cd4c421c8cb04b5991ded7102add896d06555696a8059df37fd1d8f7374487a12dfa594c9cd --- contrib/debian/copyright | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/contrib/debian/copyright b/contrib/debian/copyright index af24c9c258e5..d2d1c4394131 100644 --- a/contrib/debian/copyright +++ b/contrib/debian/copyright @@ -17,14 +17,6 @@ Copyright: 2010-2011, Jonas Smedegaard 2011, Matt Corallo License: GPL-2+ -Files: src/secp256k1/build-aux/m4/ax_jni_include_dir.m4 -Copyright: 2008 Don Anderson -License: GNU-All-permissive-License - -Files: src/secp256k1/build-aux/m4/ax_prog_cc_for_build.m4 -Copyright: 2008 Paolo Bonzini -License: GNU-All-permissive-License - Files: src/qt/res/icons/proxy.png src/qt/res/src/proxy.svg @@ -56,12 +48,6 @@ License: Expat TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -License: GNU-All-permissive-License - Copying and distribution of this file, with or without modification, are - permitted in any medium without royalty provided the copyright notice - and this notice are preserved. This file is offered as-is, without any - warranty. - License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the From 06f3ffe58a12a0a3560aa9976a1ebd50e17d02ee Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Wed, 18 Jan 2023 12:03:41 +0100 Subject: [PATCH 11/11] Merge bitcoin/bitcoin#26912: ci: Bump --combinedlogslen to debug intermittent issues faddb7373ad3ff22f88ccc97913168ec76073618 ci: Bump --combinedlogslen to debug intermittent issues (MarcoFalke) Pull request description: May help to debug intermittent issues such as https://github.com/bitcoin/bitcoin/issues/26808 ACKs for top commit: fanquake: ACK faddb7373ad3ff22f88ccc97913168ec76073618 - if this is going to improve the chance of tracking down intermittent failures. Tree-SHA512: f844856ede71b9fb816c39bfba6241e35480db71bdc2e534d4746a666114bfc82f9dea804f70201fbf8af32eb579b7eab3c164a0bb2f77268b5554467ff6e97d --- ci/dash/test_integrationtests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/dash/test_integrationtests.sh b/ci/dash/test_integrationtests.sh index b4b0304b2ad8..a5973a56bad9 100755 --- a/ci/dash/test_integrationtests.sh +++ b/ci/dash/test_integrationtests.sh @@ -44,7 +44,7 @@ EXTRA_ARGS="--dashd-arg=-socketevents=$SOCKETEVENTS" set +e # shellcheck disable=SC2086 -LD_LIBRARY_PATH="$DEPENDS_DIR/$HOST/lib" ./test/functional/test_runner.py --ci --attempts=3 --ansi --combinedlogslen=4000 --timeout-factor="${TEST_RUNNER_TIMEOUT_FACTOR}" ${TEST_RUNNER_EXTRA} --failfast --nocleanup --tmpdir="$(pwd)/testdatadirs" $PASS_ARGS $EXTRA_ARGS +LD_LIBRARY_PATH="$DEPENDS_DIR/$HOST/lib" ./test/functional/test_runner.py --ci --attempts=3 --ansi --combinedlogslen=99999999 --timeout-factor="${TEST_RUNNER_TIMEOUT_FACTOR}" ${TEST_RUNNER_EXTRA} --failfast --nocleanup --tmpdir="$(pwd)/testdatadirs" $PASS_ARGS $EXTRA_ARGS RESULT=$? set -e