mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-27 03:33:27 -03:00
[Qt] paymentserver: start netManager in uiReady()
- remove explicit init of netManager as this is done in the constructor anyway - move initNetManager() call to uiReady(), which removes an assert() and allows us to use message() in initNetManager() (currently unused but could be necessary because of proxy related messages) - make initNetManager() private - update paymentservertests.cpp
This commit is contained in:
parent
59be91ae1e
commit
7634e0d8de
4 changed files with 4 additions and 6 deletions
|
@ -308,7 +308,6 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
PaymentServer::LoadRootCAs();
|
PaymentServer::LoadRootCAs();
|
||||||
paymentServer->setOptionsModel(&optionsModel);
|
paymentServer->setOptionsModel(&optionsModel);
|
||||||
paymentServer->initNetManager();
|
|
||||||
|
|
||||||
if (splashref)
|
if (splashref)
|
||||||
splash.finish(&window);
|
splash.finish(&window);
|
||||||
|
|
|
@ -341,7 +341,7 @@ void PaymentServer::initNetManager()
|
||||||
|
|
||||||
void PaymentServer::uiReady()
|
void PaymentServer::uiReady()
|
||||||
{
|
{
|
||||||
assert(netManager != NULL); // Must call initNetManager before uiReady()
|
initNetManager();
|
||||||
|
|
||||||
saveURIs = false;
|
saveURIs = false;
|
||||||
foreach (const QString& s, savedPaymentRequests)
|
foreach (const QString& s, savedPaymentRequests)
|
||||||
|
|
|
@ -77,9 +77,6 @@ public:
|
||||||
// Return certificate store
|
// Return certificate store
|
||||||
static X509_STORE* getCertStore() { return certStore; }
|
static X509_STORE* getCertStore() { return certStore; }
|
||||||
|
|
||||||
// Setup networking
|
|
||||||
void initNetManager();
|
|
||||||
|
|
||||||
// Constructor registers this on the parent QApplication to
|
// Constructor registers this on the parent QApplication to
|
||||||
// receive QEvent::FileOpen events
|
// receive QEvent::FileOpen events
|
||||||
bool eventFilter(QObject *object, QEvent *event);
|
bool eventFilter(QObject *object, QEvent *event);
|
||||||
|
@ -117,6 +114,9 @@ private:
|
||||||
void handleURIOrFile(const QString& s);
|
void handleURIOrFile(const QString& s);
|
||||||
void fetchRequest(const QUrl& url);
|
void fetchRequest(const QUrl& url);
|
||||||
|
|
||||||
|
// Setup networking
|
||||||
|
void initNetManager();
|
||||||
|
|
||||||
bool saveURIs; // true during startup
|
bool saveURIs; // true during startup
|
||||||
QLocalServer* uriServer;
|
QLocalServer* uriServer;
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,6 @@ void PaymentServerTests::paymentServerTests()
|
||||||
X509_STORE_add_cert(caStore, parse_b64der_cert(caCert_BASE64));
|
X509_STORE_add_cert(caStore, parse_b64der_cert(caCert_BASE64));
|
||||||
PaymentServer::LoadRootCAs(caStore);
|
PaymentServer::LoadRootCAs(caStore);
|
||||||
server->setOptionsModel(&optionsModel);
|
server->setOptionsModel(&optionsModel);
|
||||||
server->initNetManager();
|
|
||||||
server->uiReady();
|
server->uiReady();
|
||||||
|
|
||||||
// Now feed PaymentRequests to server, and observe signals it produces:
|
// Now feed PaymentRequests to server, and observe signals it produces:
|
||||||
|
|
Loading…
Add table
Reference in a new issue