aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/bitcoin.cpp')
-rw-r--r--src/qt/bitcoin.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index 54f96f4426..57ce7da361 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -313,11 +313,16 @@ int main(int argc, char *argv[])
splash.finish(&window);
ClientModel clientModel(&optionsModel);
- WalletModel walletModel(pwalletMain, &optionsModel);
+ WalletModel *walletModel = 0;
+ if(pwalletMain)
+ walletModel = new WalletModel(pwalletMain, &optionsModel);
window.setClientModel(&clientModel);
- window.addWallet("~Default", &walletModel);
- window.setCurrentWallet("~Default");
+ if(walletModel)
+ {
+ window.addWallet("~Default", walletModel);
+ window.setCurrentWallet("~Default");
+ }
// If -min option passed, start window minimized.
if(GetBoolArg("-min", false))
@@ -335,8 +340,11 @@ int main(int argc, char *argv[])
&window, SLOT(handlePaymentRequest(SendCoinsRecipient)));
QObject::connect(&window, SIGNAL(receivedURI(QString)),
paymentServer, SLOT(handleURIOrFile(QString)));
- QObject::connect(&walletModel, SIGNAL(coinsSent(CWallet*,SendCoinsRecipient,QByteArray)),
- paymentServer, SLOT(fetchPaymentACK(CWallet*,const SendCoinsRecipient&,QByteArray)));
+ if(walletModel)
+ {
+ QObject::connect(walletModel, SIGNAL(coinsSent(CWallet*,SendCoinsRecipient,QByteArray)),
+ paymentServer, SLOT(fetchPaymentACK(CWallet*,const SendCoinsRecipient&,QByteArray)));
+ }
QObject::connect(paymentServer, SIGNAL(message(QString,QString,unsigned int)),
guiref, SLOT(message(QString,QString,unsigned int)));
QTimer::singleShot(100, paymentServer, SLOT(uiReady()));
@@ -347,6 +355,7 @@ int main(int argc, char *argv[])
window.setClientModel(0);
window.removeAllWallets();
guiref = 0;
+ delete walletModel;
}
// Shutdown the core and its threads, but don't exit Bitcoin-Qt here
threadGroup.interrupt_all();