#include "headers.h"
#include "init.h"
#include "qtipcserver.h"
+#include "util.h"
#include <QApplication>
#include <QMessageBox>
if (modal)
while (!guiref)
- sleep(1);
+ Sleep(1000);
// Message from network thread
if(guiref)
return QCoreApplication::translate("bitcoin-core", psz).toStdString();
}
+/* Handle runaway exceptions. Shows a message box with the problem and quits the program.
+ */
+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));
+ exit(1);
+}
+
#ifndef BITCOIN_QT_TEST
int main(int argc, char *argv[])
{
return 1;
}
} catch (std::exception& e) {
- PrintException(&e, "Runaway exception");
+ handleRunawayException(&e);
} catch (...) {
- PrintException(NULL, "Runaway exception");
+ handleRunawayException(NULL);
}
return 0;
}