diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h --- a/src/qt/paymentserver.h +++ b/src/qt/paymentserver.h @@ -35,14 +35,18 @@ #ifdef ENABLE_BIP70 #include #endif +#include #include -#include #include #include class OptionsModel; +namespace interfaces { +class Node; +} // namespace interfaces + QT_BEGIN_NAMESPACE class QApplication; class QByteArray; @@ -123,7 +127,7 @@ #ifdef ENABLE_BIP70 // Submit Payment message to a merchant, get back PaymentACK: - void fetchPaymentACK(WalletModel *walletModel, + void fetchPaymentACK(interfaces::Wallet &wallet, const SendCoinsRecipient &recipient, QByteArray transaction); #endif diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -710,7 +710,7 @@ netManager->get(netRequest); } -void PaymentServer::fetchPaymentACK(WalletModel *walletModel, +void PaymentServer::fetchPaymentACK(interfaces::Wallet &wallet, const SendCoinsRecipient &recipient, QByteArray transaction) { const payments::PaymentDetails &details = @@ -734,10 +734,10 @@ // Create a new refund address, or re-use: CTxDestination dest; const OutputType change_type = - walletModel->wallet().getDefaultChangeType() != OutputType::CHANGE_AUTO - ? walletModel->wallet().getDefaultChangeType() - : walletModel->wallet().getDefaultAddressType(); - if (walletModel->wallet().getNewDestination(change_type, "", dest)) { + wallet.getDefaultChangeType() != OutputType::CHANGE_AUTO + ? wallet.getDefaultChangeType() + : wallet.getDefaultAddressType(); + if (wallet.getNewDestination(change_type, "", dest)) { // BIP70 requests encode the scriptPubKey directly, so we are not // restricted to address types supported by the receiver. As a result, // we choose the address format we also use for change. Despite an @@ -747,7 +747,7 @@ std::string label = tr("Refund from %1") .arg(recipient.authenticatedMerchant) .toStdString(); - walletModel->wallet().setAddressBook(dest, label, "refund"); + wallet.setAddressBook(dest, label, "refund"); CScript s = GetScriptForDestination(dest); payments::Output *refund_to = payment.add_refund_to(); diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/src/qt/walletcontroller.h b/src/qt/walletcontroller.h --- a/src/qt/walletcontroller.h +++ b/src/qt/walletcontroller.h @@ -5,6 +5,7 @@ #ifndef BITCOIN_QT_WALLETCONTROLLER_H #define BITCOIN_QT_WALLETCONTROLLER_H +#include #include #include #include @@ -66,7 +67,7 @@ void walletAdded(WalletModel *wallet_model); void walletRemoved(WalletModel *wallet_model); - void coinsSent(WalletModel *wallet_model, SendCoinsRecipient recipient, + void coinsSent(interfaces::Wallet &wallet, SendCoinsRecipient recipient, QByteArray transaction); private: diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -209,7 +209,7 @@ unsigned int style); // Coins sent: from wallet, to recipient, in (serialized) transaction: - void coinsSent(WalletModel *wallet, SendCoinsRecipient recipient, + void coinsSent(interfaces::Wallet &wallet, SendCoinsRecipient recipient, QByteArray transaction); // Show progress dialog e.g. for rescan diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -285,7 +285,7 @@ m_wallet->setAddressBook(dest, strLabel, ""); } } - Q_EMIT coinsSent(this, rcp, transaction_array); + Q_EMIT coinsSent(this->wallet(), rcp, transaction_array); } // update balance immediately, otherwise there could be a short noticeable diff --git a/test/lint/lint-circular-dependencies.sh b/test/lint/lint-circular-dependencies.sh --- a/test/lint/lint-circular-dependencies.sh +++ b/test/lint/lint-circular-dependencies.sh @@ -20,7 +20,6 @@ "qt/bitcoingui -> qt/walletframe -> qt/bitcoingui" "qt/bitcoingui -> qt/walletview -> qt/bitcoingui" "qt/clientmodel -> qt/peertablemodel -> qt/clientmodel" - "qt/paymentserver -> qt/walletmodel -> qt/paymentserver" "qt/recentrequeststablemodel -> qt/walletmodel -> qt/recentrequeststablemodel" "qt/transactiontablemodel -> qt/walletmodel -> qt/transactiontablemodel" "qt/walletmodel -> qt/walletmodeltransaction -> qt/walletmodel"