Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport: trivial 2024 03 22 #5951

Merged
10 commits merged into from
Mar 26, 2024
Merged
11 changes: 3 additions & 8 deletions depends/packages/libxcb.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
6 changes: 3 additions & 3 deletions src/bitcoin-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::chrono::seconds>().count() + timeout;
const auto deadline{GetTime<std::chrono::microseconds>() + 1s * timeout};

do {
try {
Expand All @@ -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<std::chrono::seconds>().count();
const auto now{GetTime<std::chrono::microseconds>()};
if (fWait && (timeout <= 0 || now < deadline)) {
UninterruptibleSleep(std::chrono::seconds{1});
UninterruptibleSleep(1s);
} else {
throw CConnectionFailed(strprintf("timeout on transient error: %s", e.what()));
}
Expand Down
6 changes: 6 additions & 0 deletions src/qt/createwalletdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 2 additions & 3 deletions src/validation.h
Original file line number Diff line number Diff line change
Expand Up @@ -629,9 +629,8 @@ class CChainState
* 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. */
Expand Down Expand Up @@ -828,7 +827,7 @@ class CChainState

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;
Expand Down
5 changes: 3 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions test/functional/test_framework/blocktools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()}')
Comment on lines +226 to +230
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

22149: NOTE: this code was later removed in 22308

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but 22308 is not backported yet - so, that's fine, isn't it?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I just made a note to myself while reviewing it cause it says "temporary" :)

assert_equal(final_psbt["complete"], True)
return final_psbt['hex']

Expand Down
1 change: 1 addition & 0 deletions test/functional/wallet_listsinceblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def test_double_spend(self):
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]
Expand Down
2 changes: 1 addition & 1 deletion test/functional/wallet_multiwallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def wallet_file(name):
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
Expand Down
3 changes: 0 additions & 3 deletions test/sanitizer_suppressions/tsan
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading