diff --git a/depends/packages/libxcb.mk b/depends/packages/libxcb.mk index 82edcc2be0..fa30e80f5c 100644 --- a/depends/packages/libxcb.mk +++ b/depends/packages/libxcb.mk @@ -19,17 +19,12 @@ $(package)_config_opts += --disable-xtest --disable-xv --disable-xvmc endef define $(package)_preprocess_cmds - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux &&\ + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux && \ sed "s/pthread-stubs//" -i configure endef -# Don't install xcb headers to the default path in order to work around a qt -# build issue: https://bugreports.qt.io/browse/QTBUG-34748 -# When using qt's internal libxcb, it may end up finding the real headers in -# depends staging. Use a non-default path to avoid that. - define $(package)_config_cmds - $($(package)_autoconf) --includedir=$(host_prefix)/include/xcb-shared + $($(package)_autoconf) endef define $(package)_build_cmds @@ -41,5 +36,5 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds - rm -rf share/man share/doc lib/*.la + rm -rf share lib/*.la endef diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 8d6f793832..b1631e410b 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -735,7 +735,7 @@ static UniValue ConnectAndCallRPC(BaseRequestHandler* rh, const std::string& str // Execute and handle connection failures with -rpcwait. const bool fWait = gArgs.GetBoolArg("-rpcwait", false); const int timeout = gArgs.GetArg("-rpcwaittimeout", DEFAULT_WAIT_CLIENT_TIMEOUT); - const int64_t deadline = GetTime().count() + timeout; + const auto deadline{GetTime() + 1s * timeout}; do { try { @@ -748,9 +748,9 @@ static UniValue ConnectAndCallRPC(BaseRequestHandler* rh, const std::string& str } break; // Connection succeeded, no need to retry. } catch (const CConnectionFailed& e) { - const int64_t now = GetTime().count(); + const auto now{GetTime()}; if (fWait && (timeout <= 0 || now < deadline)) { - UninterruptibleSleep(std::chrono::seconds{1}); + UninterruptibleSleep(1s); } else { throw CConnectionFailed(strprintf("timeout on transient error: %s", e.what())); } diff --git a/src/qt/createwalletdialog.cpp b/src/qt/createwalletdialog.cpp index 37ccd17edb..450d50dc12 100644 --- a/src/qt/createwalletdialog.cpp +++ b/src/qt/createwalletdialog.cpp @@ -52,6 +52,12 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) : } }); + connect(ui->blank_wallet_checkbox, &QCheckBox::toggled, [this](bool checked) { + if (!checked) { + ui->disable_privkeys_checkbox->setChecked(false); + } + }); + #ifndef USE_SQLITE ui->descriptor_checkbox->setToolTip(tr("Compiled without sqlite support (required for descriptor wallets)")); ui->descriptor_checkbox->setEnabled(false); diff --git a/src/validation.cpp b/src/validation.cpp index 3387f746b9..9a7336915f 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3688,10 +3688,7 @@ void CChainState::ReceivedBlockTransactions(const CBlock& block, CBlockIndex* pi CBlockIndex *pindex = queue.front(); queue.pop_front(); pindex->nChainTx = (pindex->pprev ? pindex->pprev->nChainTx : 0) + pindex->nTx; - { - LOCK(cs_nBlockSequenceId); - pindex->nSequenceId = nBlockSequenceId++; - } + pindex->nSequenceId = nBlockSequenceId++; if (m_chain.Tip() == nullptr || !setBlockIndexCandidates.value_comp()(pindex, m_chain.Tip())) { if (!(pindex->nStatus & BLOCK_CONFLICT_CHAINLOCK)) { setBlockIndexCandidates.insert(pindex); diff --git a/src/validation.h b/src/validation.h index 3bfe6b872d..1b6b1bb28c 100644 --- a/src/validation.h +++ b/src/validation.h @@ -629,9 +629,8 @@ protected: * Every received block is assigned a unique and increasing identifier, so we * know which one to give priority in case of a fork. */ - RecursiveMutex cs_nBlockSequenceId; /** Blocks loaded from disk are assigned id 0, so start the counter at 1. */ - int32_t nBlockSequenceId = 1; + int32_t nBlockSequenceId GUARDED_BY(::cs_main) = 1; /** Decreasing counter (used by subsequent preciousblock calls). */ int32_t nBlockReverseSequenceId = -1; /** chainwork for the last block that preciousblock has been applied to. */ @@ -828,7 +827,7 @@ public: void PruneBlockIndexCandidates(); - void UnloadBlockIndex(); + void UnloadBlockIndex() EXCLUSIVE_LOCKS_REQUIRED(::cs_main); /** Check whether we are doing an initial block download (synchronizing from disk or network) */ bool IsInitialBlockDownload() const; diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index e106d5ef72..6e50dcdfd9 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1617,9 +1617,10 @@ CAmount CWallet::GetChange(const CTransaction& tx) const bool CWallet::IsHDEnabled() const { // All Active ScriptPubKeyMans must be HD for this to be true - bool result = true; + bool result = false; for (const auto& spk_man : GetActiveScriptPubKeyMans()) { - result &= spk_man->IsHDEnabled(); + if (!spk_man->IsHDEnabled()) return false; + result = true; } return result; } diff --git a/test/functional/test_framework/blocktools.py b/test/functional/test_framework/blocktools.py index d0eb93ec3b..f797c4b6b8 100644 --- a/test/functional/test_framework/blocktools.py +++ b/test/functional/test_framework/blocktools.py @@ -223,6 +223,11 @@ def create_raw_transaction(node, txid, to_address, *, amount): signed_psbt = wrpc.walletprocesspsbt(psbt) psbt = signed_psbt['psbt'] final_psbt = node.finalizepsbt(psbt) + if not final_psbt["complete"]: + node.log.info(f'final_psbt={final_psbt}') + for w in node.listwallets(): + wrpc = node.get_wallet_rpc(w) + node.log.info(f'listunspent={wrpc.listunspent()}') assert_equal(final_psbt["complete"], True) return final_psbt['hex'] diff --git a/test/functional/wallet_listsinceblock.py b/test/functional/wallet_listsinceblock.py index eb68ab5815..d1b21f5810 100755 --- a/test/functional/wallet_listsinceblock.py +++ b/test/functional/wallet_listsinceblock.py @@ -192,6 +192,7 @@ class ListSinceBlockTest(BitcoinTestFramework): address = key_to_p2pkh(eckey.get_pubkey().get_bytes()) self.nodes[2].sendtoaddress(address, 10) self.nodes[2].generate(6) + self.sync_all() self.nodes[2].importprivkey(privkey) utxos = self.nodes[2].listunspent() utxo = [u for u in utxos if u["address"] == address][0] diff --git a/test/functional/wallet_multiwallet.py b/test/functional/wallet_multiwallet.py index 9fb15b365f..dc095fcaf1 100755 --- a/test/functional/wallet_multiwallet.py +++ b/test/functional/wallet_multiwallet.py @@ -130,7 +130,7 @@ class MultiWalletTest(BitcoinTestFramework): os.mkdir(wallet_dir('no_access')) os.chmod(wallet_dir('no_access'), 0) try: - with self.nodes[0].assert_debug_log(expected_msgs=['Too many levels of symbolic links', 'Error scanning']): + with self.nodes[0].assert_debug_log(expected_msgs=['Error scanning']): walletlist = self.nodes[0].listwalletdir()['wallets'] finally: # Need to ensure access is restored for cleanup diff --git a/test/sanitizer_suppressions/tsan b/test/sanitizer_suppressions/tsan index 7d9f96dc96..b76ee223b3 100644 --- a/test/sanitizer_suppressions/tsan +++ b/test/sanitizer_suppressions/tsan @@ -6,9 +6,6 @@ # Data races from zmq namespace race:zmq::* -# race (TODO fix) -race:validation_chainstatemanager_tests - # double locks (TODO fix) mutex:g_genesis_wait_mutex mutex:Interrupt