aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/init.cpp2
-rw-r--r--src/qt/bitcoin.cpp3
-rw-r--r--src/qt/test/addressbooktests.cpp2
-rw-r--r--src/qt/test/apptests.cpp2
-rw-r--r--src/qt/test/test_main.cpp4
-rw-r--r--src/qt/test/wallettests.cpp8
-rw-r--r--src/qt/transactiondesc.cpp58
-rw-r--r--src/util/threadnames.cpp2
8 files changed, 58 insertions, 23 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 7c752d615a..8c0d599435 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -481,7 +481,7 @@ void SetupServerArgs()
"and level 4 tries to reconnect the blocks, "
"each level includes the checks of the previous levels "
"(0-4, default: %u)", DEFAULT_CHECKLEVEL), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
- gArgs.AddArg("-checkblockindex", strprintf("Do a full consistency check for the block tree, setBlockIndexCandidates, ::ChainActive() and mapBlocksUnlinked occasionally. (default: %u, regtest: %u)", defaultChainParams->DefaultConsistencyChecks(), regtestChainParams->DefaultConsistencyChecks()), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
+ gArgs.AddArg("-checkblockindex", strprintf("Do a consistency check for the block tree, chainstate, and other validation data structures occasionally. (default: %u, regtest: %u)", defaultChainParams->DefaultConsistencyChecks(), regtestChainParams->DefaultConsistencyChecks()), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
gArgs.AddArg("-checkmempool=<n>", strprintf("Run checks every <n> transactions (default: %u, regtest: %u)", defaultChainParams->DefaultConsistencyChecks(), regtestChainParams->DefaultConsistencyChecks()), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
gArgs.AddArg("-checkpoints", strprintf("Disable expensive verification for known chain history (default: %u)", DEFAULT_CHECKPOINTS_ENABLED), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
gArgs.AddArg("-deprecatedrpc=<method>", "Allows deprecated RPC method(s) to be used", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index 46f8deee57..ec6075c8fb 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -436,9 +436,6 @@ int GuiMain(int argc, char* argv[])
#if QT_VERSION >= 0x050600
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
-#ifdef Q_OS_MAC
- QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
-#endif
BitcoinApplication app(*node);
diff --git a/src/qt/test/addressbooktests.cpp b/src/qt/test/addressbooktests.cpp
index 11a518ebd2..4fe440a679 100644
--- a/src/qt/test/addressbooktests.cpp
+++ b/src/qt/test/addressbooktests.cpp
@@ -146,7 +146,7 @@ void AddressBookTests::addressBookTests()
// and fails to handle returned nulls
// (https://bugreports.qt.io/browse/QTBUG-49686).
QWARN("Skipping AddressBookTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
- "with 'test_bitcoin-qt -platform cocoa' on mac, or else use a linux or windows build.");
+ "with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build.");
return;
}
#endif
diff --git a/src/qt/test/apptests.cpp b/src/qt/test/apptests.cpp
index 8ae01ac093..e730c8f6d5 100644
--- a/src/qt/test/apptests.cpp
+++ b/src/qt/test/apptests.cpp
@@ -57,7 +57,7 @@ void AppTests::appTests()
// and fails to handle returned nulls
// (https://bugreports.qt.io/browse/QTBUG-49686).
QWARN("Skipping AppTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
- "with 'test_bitcoin-qt -platform cocoa' on mac, or else use a linux or windows build.");
+ "with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build.");
return;
}
#endif
diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp
index 796cf24b36..c39266a397 100644
--- a/src/qt/test/test_main.cpp
+++ b/src/qt/test/test_main.cpp
@@ -61,9 +61,9 @@ int main(int argc, char *argv[])
// platform ("xcb", "windows", or "cocoa") so tests can't unintentionally
// interfere with any background GUIs and don't require extra resources.
#if defined(WIN32)
- _putenv_s("QT_QPA_PLATFORM", "minimal");
+ if (getenv("QT_QPA_PLATFORM") == nullptr) _putenv_s("QT_QPA_PLATFORM", "minimal");
#else
- setenv("QT_QPA_PLATFORM", "minimal", 0);
+ setenv("QT_QPA_PLATFORM", "minimal", /* overwrite */ 0);
#endif
// Don't remove this, it's needed to access
diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp
index 120dff95c0..eea874c0d4 100644
--- a/src/qt/test/wallettests.cpp
+++ b/src/qt/test/wallettests.cpp
@@ -123,9 +123,9 @@ void BumpFee(TransactionView& view, const uint256& txid, bool expectDisabled, st
//
// This also requires overriding the default minimal Qt platform:
//
-// src/qt/test/test_bitcoin-qt -platform xcb # Linux
-// src/qt/test/test_bitcoin-qt -platform windows # Windows
-// src/qt/test/test_bitcoin-qt -platform cocoa # macOS
+// QT_QPA_PLATFORM=xcb src/qt/test/test_bitcoin-qt # Linux
+// QT_QPA_PLATFORM=windows src/qt/test/test_bitcoin-qt # Windows
+// QT_QPA_PLATFORM=cocoa src/qt/test/test_bitcoin-qt # macOS
void TestGUI()
{
// Set up wallet and chain with 105 blocks (5 mature blocks for spending).
@@ -256,7 +256,7 @@ void WalletTests::walletTests()
// and fails to handle returned nulls
// (https://bugreports.qt.io/browse/QTBUG-49686).
QWARN("Skipping WalletTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
- "with 'test_bitcoin-qt -platform cocoa' on mac, or else use a linux or windows build.");
+ "with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build.");
return;
}
#endif
diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp
index ebe7925368..648fdb7673 100644
--- a/src/qt/transactiondesc.cpp
+++ b/src/qt/transactiondesc.cpp
@@ -49,6 +49,36 @@ QString TransactionDesc::FormatTxStatus(const interfaces::WalletTx& wtx, const i
}
}
+#ifndef ENABLE_BIP70
+// Takes an encoded PaymentRequest as a string and tries to find the Common Name of the X.509 certificate
+// used to sign the PaymentRequest.
+bool GetPaymentRequestMerchant(const std::string& pr, QString& merchant)
+{
+ // Search for the supported pki type strings
+ if (pr.find(std::string({0x12, 0x0b}) + "x509+sha256") != std::string::npos || pr.find(std::string({0x12, 0x09}) + "x509+sha1") != std::string::npos) {
+ // We want the common name of the Subject of the cert. This should be the second occurrence
+ // of the bytes 0x0603550403. The first occurrence of those is the common name of the issuer.
+ // After those bytes will be either 0x13 or 0x0C, then length, then either the ascii or utf8
+ // string with the common name which is the merchant name
+ size_t cn_pos = pr.find({0x06, 0x03, 0x55, 0x04, 0x03});
+ if (cn_pos != std::string::npos) {
+ cn_pos = pr.find({0x06, 0x03, 0x55, 0x04, 0x03}, cn_pos + 5);
+ if (cn_pos != std::string::npos) {
+ cn_pos += 5;
+ if (pr[cn_pos] == 0x13 || pr[cn_pos] == 0x0c) {
+ cn_pos++; // Consume the type
+ int str_len = pr[cn_pos];
+ cn_pos++; // Consume the string length
+ merchant = QString::fromUtf8(pr.data() + cn_pos, str_len);
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+}
+#endif
+
QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wallet, TransactionRecord *rec, int unit)
{
int numBlocks;
@@ -255,26 +285,34 @@ QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wall
strHTML += "<b>" + tr("Output index") + ":</b> " + QString::number(rec->getOutputIndex()) + "<br>";
// Message from normal bitcoin:URI (bitcoin:123...?message=example)
- for (const std::pair<std::string, std::string>& r : orderForm)
+ for (const std::pair<std::string, std::string>& r : orderForm) {
if (r.first == "Message")
strHTML += "<br><b>" + tr("Message") + ":</b><br>" + GUIUtil::HtmlEscape(r.second, true) + "<br>";
-#ifdef ENABLE_BIP70
- //
- // PaymentRequest info:
- //
- for (const std::pair<std::string, std::string>& r : orderForm)
- {
+ //
+ // PaymentRequest info:
+ //
if (r.first == "PaymentRequest")
{
+ QString merchant;
+#ifdef ENABLE_BIP70
PaymentRequestPlus req;
req.parse(QByteArray::fromRawData(r.second.data(), r.second.size()));
- QString merchant;
- if (req.getMerchant(PaymentServer::getCertStore(), merchant))
+ if (!req.getMerchant(PaymentServer::getCertStore(), merchant)) {
+ merchant.clear();
+ }
+#else
+ if (!GetPaymentRequestMerchant(r.second, merchant)) {
+ merchant.clear();
+ } else {
+ merchant += tr(" (Certificate was not verified)");
+ }
+#endif
+ if (!merchant.isNull()) {
strHTML += "<b>" + tr("Merchant") + ":</b> " + GUIUtil::HtmlEscape(merchant) + "<br>";
+ }
}
}
-#endif
if (wtx.is_coinbase)
{
diff --git a/src/util/threadnames.cpp b/src/util/threadnames.cpp
index b221b0c975..c25e9ed661 100644
--- a/src/util/threadnames.cpp
+++ b/src/util/threadnames.cpp
@@ -57,6 +57,6 @@ static void SetInternalName(std::string name) { }
void util::ThreadRename(std::string&& name)
{
- SetThreadName(("bitcoin-" + name).c_str());
+ SetThreadName(("b-" + name).c_str());
SetInternalName(std::move(name));
}