diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2013-07-22 16:50:39 +1000 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-08-22 16:18:25 +1000 |
commit | a41d5fe01947f2f878c055670986a165af800f9a (patch) | |
tree | 40eeada1ebc180f8e3669a7d164104686dc0c618 /src/qt/bitcoin.cpp | |
parent | 47d0534368fbf0e3fb2cad7d05d60501d29f62aa (diff) |
Payment Protocol: X509-validated payment requests
Add support for a Payment Protocol to Bitcoin-Qt.
Payment messages are protocol-buffer encoded and communicated over
http(s), so this adds a dependency on the Google protocol buffer
library, and requires Qt with OpenSSL support.
Diffstat (limited to 'src/qt/bitcoin.cpp')
-rw-r--r-- | src/qt/bitcoin.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 5ab5d1f7ee..e7cf440044 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -213,7 +213,7 @@ int main(int argc, char *argv[]) // Do this early as we don't want to bother initializing if we are just calling IPC // ... but do it after creating app and setting up translations, so errors are // translated properly. - if (PaymentServer::ipcSendCommandLine()) + if (PaymentServer::ipcSendCommandLine(argc, argv)) exit(0); // Now that translations are initialized check for errors and allow a translatable error message @@ -299,6 +299,9 @@ int main(int argc, char *argv[]) optionsModel.Upgrade(); // Must be done after AppInit2 + PaymentServer::LoadRootCAs(); + paymentServer->initNetManager(optionsModel); + if (splashref) splash.finish(&window); @@ -320,8 +323,15 @@ int main(int argc, char *argv[]) } // Now that initialization/startup is done, process any command-line - // bitcoin: URIs - QObject::connect(paymentServer, SIGNAL(receivedURI(QString)), &window, SLOT(handleURI(QString))); + // bitcoin: URIs or payment requests: + QObject::connect(paymentServer, SIGNAL(receivedPaymentRequest(SendCoinsRecipient)), + &window, SLOT(handlePaymentRequest(SendCoinsRecipient))); + QObject::connect(&walletModel, SIGNAL(coinsSent(CWallet*,SendCoinsRecipient,QByteArray)), + paymentServer, SLOT(fetchPaymentACK(CWallet*,const SendCoinsRecipient&,QByteArray))); + QObject::connect(paymentServer, SIGNAL(receivedPaymentACK(QString)), + &window, SLOT(showPaymentACK(QString))); + QObject::connect(paymentServer, SIGNAL(reportError(QString, QString, unsigned int)), + guiref, SLOT(message(QString, QString, unsigned int))); QTimer::singleShot(100, paymentServer, SLOT(uiReady())); app.exec(); |