Bitcoin-Qt: Use qDebug() for printing to debug.log

- removes all usages of PrintDebugStringF from Qt code
- ensure same format for all debug.log messages "functionname : Message"
This commit is contained in:
Philip Kaufmann 2013-09-04 11:52:45 +02:00
parent d22d9753cc
commit 42018eff07
7 changed files with 67 additions and 52 deletions

View File

@ -7,6 +7,7 @@
#include "base58.h" #include "base58.h"
#include <QFont> #include <QFont>
#include <QDebug>
const QString AddressTableModel::Send = "S"; const QString AddressTableModel::Send = "S";
const QString AddressTableModel::Receive = "R"; const QString AddressTableModel::Receive = "R";
@ -109,7 +110,7 @@ public:
case CT_NEW: case CT_NEW:
if(inModel) if(inModel)
{ {
OutputDebugStringF("Warning: AddressTablePriv::updateEntry: Got CT_NOW, but entry is already in model\n"); qDebug() << "AddressTablePriv::updateEntry : Warning: Got CT_NOW, but entry is already in model";
break; break;
} }
parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex); parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex);
@ -119,7 +120,7 @@ public:
case CT_UPDATED: case CT_UPDATED:
if(!inModel) if(!inModel)
{ {
OutputDebugStringF("Warning: AddressTablePriv::updateEntry: Got CT_UPDATED, but entry is not in model\n"); qDebug() << "AddressTablePriv::updateEntry : Warning: Got CT_UPDATED, but entry is not in model";
break; break;
} }
lower->type = newEntryType; lower->type = newEntryType;
@ -129,7 +130,7 @@ public:
case CT_DELETED: case CT_DELETED:
if(!inModel) if(!inModel)
{ {
OutputDebugStringF("Warning: AddressTablePriv::updateEntry: Got CT_DELETED, but entry is not in model\n"); qDebug() << "AddressTablePriv::updateEntry : Warning: Got CT_DELETED, but entry is not in model";
break; break;
} }
parent->beginRemoveRows(QModelIndex(), lowerIndex, upperIndex-1); parent->beginRemoveRows(QModelIndex(), lowerIndex, upperIndex-1);

View File

@ -13,6 +13,7 @@
#include <QDateTime> #include <QDateTime>
#include <QTimer> #include <QTimer>
#include <QDebug>
static const int64 nClientStartupTime = GetTime(); static const int64 nClientStartupTime = GetTime();
@ -180,14 +181,14 @@ static void NotifyBlocksChanged(ClientModel *clientmodel)
static void NotifyNumConnectionsChanged(ClientModel *clientmodel, int newNumConnections) static void NotifyNumConnectionsChanged(ClientModel *clientmodel, int newNumConnections)
{ {
// Too noisy: OutputDebugStringF("NotifyNumConnectionsChanged %i\n", newNumConnections); // Too noisy: qDebug() << "NotifyNumConnectionsChanged : " + QString::number(newNumConnections);
QMetaObject::invokeMethod(clientmodel, "updateNumConnections", Qt::QueuedConnection, QMetaObject::invokeMethod(clientmodel, "updateNumConnections", Qt::QueuedConnection,
Q_ARG(int, newNumConnections)); Q_ARG(int, newNumConnections));
} }
static void NotifyAlertChanged(ClientModel *clientmodel, const uint256 &hash, ChangeType status) static void NotifyAlertChanged(ClientModel *clientmodel, const uint256 &hash, ChangeType status)
{ {
OutputDebugStringF("NotifyAlertChanged %s status=%i\n", hash.GetHex().c_str(), status); qDebug() << "NotifyAlertChanged : " + QString::fromStdString(hash.GetHex()) + " status=" + QString::number(status);
QMetaObject::invokeMethod(clientmodel, "updateAlert", Qt::QueuedConnection, QMetaObject::invokeMethod(clientmodel, "updateAlert", Qt::QueuedConnection,
Q_ARG(QString, QString::fromStdString(hash.GetHex())), Q_ARG(QString, QString::fromStdString(hash.GetHex())),
Q_ARG(int, status)); Q_ARG(int, status));

View File

@ -60,8 +60,8 @@ private:
int cachedNumBlocks; int cachedNumBlocks;
int cachedNumBlocksOfPeers; int cachedNumBlocksOfPeers;
bool cachedReindexing; bool cachedReindexing;
bool cachedImporting; bool cachedImporting;
int numBlocksAtStartup; int numBlocksAtStartup;

View File

@ -24,18 +24,18 @@ bool PaymentRequestPlus::parse(const QByteArray& data)
{ {
bool parseOK = paymentRequest.ParseFromArray(data.data(), data.size()); bool parseOK = paymentRequest.ParseFromArray(data.data(), data.size());
if (!parseOK) { if (!parseOK) {
qDebug() << "Error parsing payment request"; qDebug() << "PaymentRequestPlus::parse : Error parsing payment request";
return false; return false;
} }
if (paymentRequest.payment_details_version() > 1) { if (paymentRequest.payment_details_version() > 1) {
qDebug() << "Received up-version payment details, version=" << paymentRequest.payment_details_version(); qDebug() << "PaymentRequestPlus::parse : Received up-version payment details, version=" << paymentRequest.payment_details_version();
return false; return false;
} }
parseOK = details.ParseFromString(paymentRequest.serialized_payment_details()); parseOK = details.ParseFromString(paymentRequest.serialized_payment_details());
if (!parseOK) if (!parseOK)
{ {
qDebug() << "Error parsing payment details"; qDebug() << "PaymentRequestPlus::parse : Error parsing payment details";
paymentRequest.Clear(); paymentRequest.Clear();
return false; return false;
} }
@ -75,17 +75,18 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
digestAlgorithm = EVP_sha1(); digestAlgorithm = EVP_sha1();
} }
else if (paymentRequest.pki_type() == "none") { else if (paymentRequest.pki_type() == "none") {
if (fDebug) qDebug() << "PaymentRequest: pki_type == none"; if (fDebug)
qDebug() << "PaymentRequestPlus::getMerchant : Payment request: pki_type == none";
return false; return false;
} }
else { else {
qDebug() << "PaymentRequest: unknown pki_type " << paymentRequest.pki_type().c_str(); qDebug() << "PaymentRequestPlus::getMerchant : Payment request: unknown pki_type " << paymentRequest.pki_type().c_str();
return false; return false;
} }
payments::X509Certificates certChain; payments::X509Certificates certChain;
if (!certChain.ParseFromString(paymentRequest.pki_data())) { if (!certChain.ParseFromString(paymentRequest.pki_data())) {
qDebug() << "PaymentRequest: error parsing pki_data"; qDebug() << "PaymentRequestPlus::getMerchant : Payment request: error parsing pki_data";
return false; return false;
} }
@ -95,12 +96,12 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
QByteArray certData(certChain.certificate(i).data(), certChain.certificate(i).size()); QByteArray certData(certChain.certificate(i).data(), certChain.certificate(i).size());
QSslCertificate qCert(certData, QSsl::Der); QSslCertificate qCert(certData, QSsl::Der);
if (currentTime < qCert.effectiveDate() || currentTime > qCert.expiryDate()) { if (currentTime < qCert.effectiveDate() || currentTime > qCert.expiryDate()) {
qDebug() << "PaymentRequest: certificate expired or not yet active: " << qCert; qDebug() << "PaymentRequestPlus::getMerchant : Payment request: certificate expired or not yet active: " << qCert;
return false; return false;
} }
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
if (qCert.isBlacklisted()) { if (qCert.isBlacklisted()) {
qDebug() << "PaymentRequest: certificate blacklisted: " << qCert; qDebug() << "PaymentRequestPlus::getMerchant : Payment request: certificate blacklisted: " << qCert;
return false; return false;
} }
#endif #endif
@ -110,7 +111,7 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
certs.push_back(cert); certs.push_back(cert);
} }
if (certs.empty()) { if (certs.empty()) {
qDebug() << "PaymentRequest: empty certificate chain"; qDebug() << "PaymentRequestPlus::getMerchant : Payment request: empty certificate chain";
return false; return false;
} }
@ -126,7 +127,7 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
// load the signing cert into it and verify. // load the signing cert into it and verify.
X509_STORE_CTX *store_ctx = X509_STORE_CTX_new(); X509_STORE_CTX *store_ctx = X509_STORE_CTX_new();
if (!store_ctx) { if (!store_ctx) {
qDebug() << "PaymentRequest: error creating X509_STORE_CTX"; qDebug() << "PaymentRequestPlus::getMerchant : Payment request: error creating X509_STORE_CTX";
return false; return false;
} }
@ -171,14 +172,14 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
merchant = website; merchant = website;
} }
else { else {
throw SSLVerifyError("Bad certificate, missing common name"); throw SSLVerifyError("Bad certificate, missing common name.");
} }
// TODO: detect EV certificates and set merchant = business name instead of unfriendly NID_commonName ? // TODO: detect EV certificates and set merchant = business name instead of unfriendly NID_commonName ?
} }
catch (SSLVerifyError& err) catch (SSLVerifyError& err)
{ {
fResult = false; fResult = false;
qDebug() << "PaymentRequestPlus::getMerchant SSL err: " << err.what(); qDebug() << "PaymentRequestPlus::getMerchant : SSL error: " << err.what();
} }
if (website) if (website)

View File

@ -89,7 +89,7 @@ static QList<QString> savedPaymentRequests;
static void ReportInvalidCertificate(const QSslCertificate& cert) static void ReportInvalidCertificate(const QSslCertificate& cert)
{ {
if (fDebug) { if (fDebug) {
qDebug() << "Invalid certificate: " << cert.subjectInfo(QSslCertificate::CommonName); qDebug() << "ReportInvalidCertificate : Payment server found an invalid certificate: " << cert.subjectInfo(QSslCertificate::CommonName);
} }
} }
@ -162,7 +162,7 @@ void PaymentServer::LoadRootCAs(X509_STORE* _store)
} }
} }
if (fDebug) if (fDebug)
qDebug() << "PaymentServer: loaded " << nRootCerts << " root certificates"; qDebug() << "PaymentServer::LoadRootCAs : Loaded " << nRootCerts << " root certificates";
// Project for another day: // Project for another day:
// Fetch certificate revocation lists, and add them to certStore. // Fetch certificate revocation lists, and add them to certStore.
@ -221,7 +221,7 @@ bool PaymentServer::ipcSendCommandLine(int argc, char* argv[])
} }
else else
{ {
qDebug() << "Payment request file does not exist: " << argv[i]; qDebug() << "PaymentServer::ipcSendCommandLine : Payment request file does not exist: " << argv[i];
// Printing to debug.log is about the best we can do here, the // Printing to debug.log is about the best we can do here, the
// GUI hasn't started yet so we can't pop up a message box. // GUI hasn't started yet so we can't pop up a message box.
} }
@ -271,7 +271,7 @@ PaymentServer::PaymentServer(QObject* parent,
uriServer = new QLocalServer(this); uriServer = new QLocalServer(this);
if (!uriServer->listen(name)) if (!uriServer->listen(name))
qDebug() << "Cannot start bitcoin: click-to-pay handler"; qDebug() << "PaymentServer::PaymentServer : Cannot start bitcoin: click-to-pay handler";
else else
connect(uriServer, SIGNAL(newConnection()), this, SLOT(handleURIConnection())); connect(uriServer, SIGNAL(newConnection()), this, SLOT(handleURIConnection()));
} }
@ -366,12 +366,13 @@ void PaymentServer::handleURIOrFile(const QString& s)
QString decoded = QUrl::fromPercentEncoding(temp); QString decoded = QUrl::fromPercentEncoding(temp);
QUrl fetchUrl(decoded, QUrl::StrictMode); QUrl fetchUrl(decoded, QUrl::StrictMode);
if (fDebug) qDebug() << "PaymentServer::fetchRequest " << fetchUrl; if (fDebug)
qDebug() << "PaymentServer::handleURIOrFile : fetchRequest(" << fetchUrl << ")";
if (fetchUrl.isValid()) if (fetchUrl.isValid())
fetchRequest(fetchUrl); fetchRequest(fetchUrl);
else else
qDebug() << "PaymentServer: invalid url: " << fetchUrl; qDebug() << "PaymentServer::handleURIOrFile : Invalid url: " << fetchUrl;
return; return;
} }
@ -420,13 +421,13 @@ bool PaymentServer::readPaymentRequest(const QString& filename, PaymentRequestPl
QFile f(filename); QFile f(filename);
if (!f.open(QIODevice::ReadOnly)) if (!f.open(QIODevice::ReadOnly))
{ {
qDebug() << "PaymentServer::readPaymentRequest fail to open " << filename; qDebug() << "PaymentServer::readPaymentRequest : Failed to open " << filename;
return false; return false;
} }
if (f.size() > MAX_PAYMENT_REQUEST_SIZE) if (f.size() > MAX_PAYMENT_REQUEST_SIZE)
{ {
qDebug() << "PaymentServer::readPaymentRequest " << filename << " too large"; qDebug() << "PaymentServer::readPaymentRequest : " << filename << " too large";
return false; return false;
} }
@ -449,7 +450,8 @@ PaymentServer::processPaymentRequest(PaymentRequestPlus& request,
if (txOut.IsDust(CTransaction::nMinRelayTxFee)) { if (txOut.IsDust(CTransaction::nMinRelayTxFee)) {
QString message = QObject::tr("Requested payment amount (%1) too small") QString message = QObject::tr("Requested payment amount (%1) too small")
.arg(BitcoinUnits::formatWithUnit(optionsModel->getDisplayUnit(), sendingTo.second)); .arg(BitcoinUnits::formatWithUnit(optionsModel->getDisplayUnit(), sendingTo.second));
qDebug() << message;
qDebug() << "PaymentServer::processPaymentRequest : " << message;
emit reportError(tr("Payment request error"), message, CClientUIInterface::MODAL); emit reportError(tr("Payment request error"), message, CClientUIInterface::MODAL);
return false; return false;
} }
@ -462,7 +464,8 @@ PaymentServer::processPaymentRequest(PaymentRequestPlus& request,
if (request.getMerchant(PaymentServer::certStore, recipients[0].authenticatedMerchant)) { if (request.getMerchant(PaymentServer::certStore, recipients[0].authenticatedMerchant)) {
recipients[0].paymentRequest = request; recipients[0].paymentRequest = request;
recipients[0].amount = totalAmount; recipients[0].amount = totalAmount;
if (fDebug) qDebug() << "PaymentRequest from " << recipients[0].authenticatedMerchant; if (fDebug)
qDebug() << "PaymentServer::processPaymentRequest : Payment request from " << recipients[0].authenticatedMerchant;
} }
else { else {
recipients.clear(); recipients.clear();
@ -483,7 +486,8 @@ PaymentServer::processPaymentRequest(PaymentRequestPlus& request,
if (i == 0) // Tie request to first pay-to, we don't want multiple ACKs if (i == 0) // Tie request to first pay-to, we don't want multiple ACKs
recipients[i].paymentRequest = request; recipients[i].paymentRequest = request;
recipients[i].address = QString::fromStdString(CBitcoinAddress(dest).ToString()); recipients[i].address = QString::fromStdString(CBitcoinAddress(dest).ToString());
if (fDebug) qDebug() << "PaymentRequest, insecure " << recipients[i].address; if (fDebug)
qDebug() << "PaymentServer::processPaymentRequest : Payment request, insecure " << recipients[i].address;
} }
else { else {
// Insecure payments to custom bitcoin addresses are not supported // Insecure payments to custom bitcoin addresses are not supported
@ -551,7 +555,7 @@ PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipient, QB
else { else {
// This should never happen, because sending coins should have just unlocked the wallet // This should never happen, because sending coins should have just unlocked the wallet
// and refilled the keypool // and refilled the keypool
qDebug() << "Error getting refund key, refund_to not set"; qDebug() << "PaymentServer::fetchPaymentACK : Error getting refund key, refund_to not set";
} }
} }
@ -563,7 +567,7 @@ PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipient, QB
} }
else { else {
// This should never happen, either: // This should never happen, either:
qDebug() << "Error serializing payment message"; qDebug() << "PaymentServer::fetchPaymentACK : Error serializing payment message";
} }
} }
@ -576,7 +580,7 @@ PaymentServer::netRequestFinished(QNetworkReply* reply)
QString message = QObject::tr("Error communicating with %1: %2") QString message = QObject::tr("Error communicating with %1: %2")
.arg(reply->request().url().toString()) .arg(reply->request().url().toString())
.arg(reply->errorString()); .arg(reply->errorString());
qDebug() << message; qDebug() << "PaymentServer::netRequestFinished : " << message;
emit reportError(tr("Network request error"), message, CClientUIInterface::MODAL); emit reportError(tr("Network request error"), message, CClientUIInterface::MODAL);
return; return;
} }
@ -594,7 +598,7 @@ PaymentServer::netRequestFinished(QNetworkReply* reply)
} }
} }
else else
qDebug() << "PaymentServer::netRequestFinished: error processing PaymentRequest"; qDebug() << "PaymentServer::netRequestFinished : Error processing payment request";
return; return;
} }
else if (requestType == "PaymentACK") else if (requestType == "PaymentACK")
@ -604,7 +608,7 @@ PaymentServer::netRequestFinished(QNetworkReply* reply)
{ {
QString message = QObject::tr("Bad response from server %1") QString message = QObject::tr("Bad response from server %1")
.arg(reply->request().url().toString()); .arg(reply->request().url().toString());
qDebug() << message; qDebug() << "PaymentServer::netRequestFinished : " << message;
emit reportError(tr("Network request error"), message, CClientUIInterface::MODAL); emit reportError(tr("Network request error"), message, CClientUIInterface::MODAL);
} }
else { else {
@ -618,7 +622,7 @@ PaymentServer::reportSslErrors(QNetworkReply* reply, const QList<QSslError> &err
{ {
QString errString; QString errString;
foreach (const QSslError& err, errs) { foreach (const QSslError& err, errs) {
qDebug() << err; qDebug() << "PaymentServer::reportSslErrors : " << err;
errString += err.errorString() + "\n"; errString += err.errorString() + "\n";
} }
emit reportError(tr("Network request error"), errString, CClientUIInterface::MODAL); emit reportError(tr("Network request error"), errString, CClientUIInterface::MODAL);

View File

@ -17,6 +17,7 @@
#include <QTimer> #include <QTimer>
#include <QIcon> #include <QIcon>
#include <QDateTime> #include <QDateTime>
#include <QDebug>
// Amount column is right-aligned it contains numbers // Amount column is right-aligned it contains numbers
static int column_alignments[] = { static int column_alignments[] = {
@ -67,7 +68,7 @@ public:
*/ */
void refreshWallet() void refreshWallet()
{ {
OutputDebugStringF("refreshWallet\n"); qDebug() << "TransactionTablePriv::refreshWallet";
cachedWallet.clear(); cachedWallet.clear();
{ {
LOCK(wallet->cs_wallet); LOCK(wallet->cs_wallet);
@ -86,7 +87,7 @@ public:
*/ */
void updateWallet(const uint256 &hash, int status) void updateWallet(const uint256 &hash, int status)
{ {
OutputDebugStringF("updateWallet %s %i\n", hash.ToString().c_str(), status); qDebug() << "TransactionTablePriv::updateWallet : " + QString::fromStdString(hash.ToString()) + " " + QString::number(status);
{ {
LOCK(wallet->cs_wallet); LOCK(wallet->cs_wallet);
@ -114,20 +115,21 @@ public:
status = CT_DELETED; /* In model, but want to hide, treat as deleted */ status = CT_DELETED; /* In model, but want to hide, treat as deleted */
} }
OutputDebugStringF(" inWallet=%i inModel=%i Index=%i-%i showTransaction=%i derivedStatus=%i\n", qDebug() << " inWallet=" + QString::number(inWallet) + " inModel=" + QString::number(inModel) +
inWallet, inModel, lowerIndex, upperIndex, showTransaction, status); " Index=" + QString::number(lowerIndex) + "-" + QString::number(upperIndex) +
" showTransaction=" + QString::number(showTransaction) + " derivedStatus=" + QString::number(status);
switch(status) switch(status)
{ {
case CT_NEW: case CT_NEW:
if(inModel) if(inModel)
{ {
OutputDebugStringF("Warning: updateWallet: Got CT_NEW, but transaction is already in model\n"); qDebug() << "TransactionTablePriv::updateWallet : Warning: Got CT_NEW, but transaction is already in model";
break; break;
} }
if(!inWallet) if(!inWallet)
{ {
OutputDebugStringF("Warning: updateWallet: Got CT_NEW, but transaction is not in wallet\n"); qDebug() << "TransactionTablePriv::updateWallet : Warning: Got CT_NEW, but transaction is not in wallet";
break; break;
} }
if(showTransaction) if(showTransaction)
@ -151,7 +153,7 @@ public:
case CT_DELETED: case CT_DELETED:
if(!inModel) if(!inModel)
{ {
OutputDebugStringF("Warning: updateWallet: Got CT_DELETED, but transaction is not in model\n"); qDebug() << "TransactionTablePriv::updateWallet : Warning: Got CT_DELETED, but transaction is not in model";
break; break;
} }
// Removed -- remove entire transaction from table // Removed -- remove entire transaction from table

View File

@ -10,6 +10,7 @@
#include <QSet> #include <QSet>
#include <QTimer> #include <QTimer>
#include <QDebug>
WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *parent) : WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *parent) :
QObject(parent), wallet(wallet), optionsModel(optionsModel), addressTableModel(0), QObject(parent), wallet(wallet), optionsModel(optionsModel), addressTableModel(0),
@ -111,7 +112,7 @@ void WalletModel::updateTransaction(const QString &hash, int status)
} }
} }
void WalletModel::updateAddressBook(const QString &address, const QString &label, void WalletModel::updateAddressBook(const QString &address, const QString &label,
bool isMine, const QString &purpose, int status) bool isMine, const QString &purpose, int status)
{ {
if(addressTableModel) if(addressTableModel)
@ -359,7 +360,7 @@ bool WalletModel::backupWallet(const QString &filename)
// Handlers for core signals // Handlers for core signals
static void NotifyKeyStoreStatusChanged(WalletModel *walletmodel, CCryptoKeyStore *wallet) static void NotifyKeyStoreStatusChanged(WalletModel *walletmodel, CCryptoKeyStore *wallet)
{ {
OutputDebugStringF("NotifyKeyStoreStatusChanged\n"); qDebug() << "NotifyKeyStoreStatusChanged";
QMetaObject::invokeMethod(walletmodel, "updateStatus", Qt::QueuedConnection); QMetaObject::invokeMethod(walletmodel, "updateStatus", Qt::QueuedConnection);
} }
@ -367,21 +368,26 @@ static void NotifyAddressBookChanged(WalletModel *walletmodel, CWallet *wallet,
const CTxDestination &address, const std::string &label, bool isMine, const CTxDestination &address, const std::string &label, bool isMine,
const std::string &purpose, ChangeType status) const std::string &purpose, ChangeType status)
{ {
OutputDebugStringF("NotifyAddressBookChanged %s %s isMine=%i purpose=%s status=%i\n", QString strAddress = QString::fromStdString(CBitcoinAddress(address).ToString());
CBitcoinAddress(address).ToString().c_str(), label.c_str(), isMine, purpose.c_str(), status); QString strLabel = QString::fromStdString(label);
QString strPurpose = QString::fromStdString(purpose);
qDebug() << "NotifyAddressBookChanged : " + strAddress + " " + strLabel + " isMine=" + QString::number(isMine) + " purpose=" + strPurpose + " status=" + QString::number(status);
QMetaObject::invokeMethod(walletmodel, "updateAddressBook", Qt::QueuedConnection, QMetaObject::invokeMethod(walletmodel, "updateAddressBook", Qt::QueuedConnection,
Q_ARG(QString, QString::fromStdString(CBitcoinAddress(address).ToString())), Q_ARG(QString, strAddress),
Q_ARG(QString, QString::fromStdString(label)), Q_ARG(QString, strLabel),
Q_ARG(bool, isMine), Q_ARG(bool, isMine),
Q_ARG(QString, QString::fromStdString(purpose)), Q_ARG(QString, strPurpose),
Q_ARG(int, status)); Q_ARG(int, status));
} }
static void NotifyTransactionChanged(WalletModel *walletmodel, CWallet *wallet, const uint256 &hash, ChangeType status) static void NotifyTransactionChanged(WalletModel *walletmodel, CWallet *wallet, const uint256 &hash, ChangeType status)
{ {
OutputDebugStringF("NotifyTransactionChanged %s status=%i\n", hash.GetHex().c_str(), status); QString strHash = QString::fromStdString(hash.GetHex());
qDebug() << "NotifyTransactionChanged : " + strHash + " status= " + QString::number(status);
QMetaObject::invokeMethod(walletmodel, "updateTransaction", Qt::QueuedConnection, QMetaObject::invokeMethod(walletmodel, "updateTransaction", Qt::QueuedConnection,
Q_ARG(QString, QString::fromStdString(hash.GetHex())), Q_ARG(QString, strHash),
Q_ARG(int, status)); Q_ARG(int, status));
} }