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.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index b4e751077..6bdac2ad7 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -109,16 +109,15 @@ static std::string Translate(const char* psz)
static void handleRunawayException(std::exception *e)
{
PrintExceptionContinue(e, "Runaway exception");
- QMessageBox::critical(0, "Runaway exception", BitcoinGUI::tr("A fatal error occured. Bitcoin can no longer continue safely and will quit.") + QString("\n\n") + QString::fromStdString(strMiscWarning));
+ QMessageBox::critical(0, "Runaway exception", BitcoinGUI::tr("A fatal error occurred. Bitcoin can no longer continue safely and will quit.") + QString("\n\n") + QString::fromStdString(strMiscWarning));
exit(1);
}
#ifndef BITCOIN_QT_TEST
int main(int argc, char *argv[])
{
-#if !defined(MAC_OSX) && !defined(WIN32)
-// TODO: implement qtipcserver.cpp for Mac and Windows
-
+// TODO: implement URI support on the Mac.
+#if !defined(MAC_OSX)
// Do this early as we don't want to bother initializing if we are just calling IPC
for (int i = 1; i < argc; i++)
{
@@ -127,13 +126,21 @@ int main(int argc, char *argv[])
const char *strURI = argv[i];
try {
boost::interprocess::message_queue mq(boost::interprocess::open_only, BITCOINURI_QUEUE_NAME);
- if(mq.try_send(strURI, strlen(strURI), 0))
+ if (mq.try_send(strURI, strlen(strURI), 0))
+ // if URI could be sent to the message queue exit here
exit(0);
else
+ // if URI could not be sent to the message queue do a normal Bitcoin-Qt startup
break;
}
catch (boost::interprocess::interprocess_exception &ex) {
- break;
+ // don't log the "file not found" exception, because that's normal for
+ // the first start of the first instance
+ if (ex.get_error_code() != boost::interprocess::not_found_error)
+ {
+ printf("main() - boost interprocess exception #%d: %s\n", ex.get_error_code(), ex.what());
+ break;
+ }
}
}
}
@@ -262,8 +269,8 @@ int main(int argc, char *argv[])
{
window.show();
}
-#if !defined(MAC_OSX) && !defined(WIN32)
-// TODO: implement qtipcserver.cpp for Mac and Windows
+// TODO: implement URI support on the Mac.
+#if !defined(MAC_OSX)
// Place this here as guiref has to be defined if we dont want to lose URIs
ipcInit();
@@ -279,6 +286,8 @@ int main(int argc, char *argv[])
mq.try_send(strURI, strlen(strURI), 0);
}
catch (boost::interprocess::interprocess_exception &ex) {
+ printf("main() - boost interprocess exception #%d: %s\n", ex.get_error_code(), ex.what());
+ break;
}
}
}