From 8ffbd6c3789843cb024a3ee425ac4cc0482eaeb7 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Thu, 3 Jan 2013 22:06:18 +0100 Subject: Bitcoin-Qt: give testnet a unique IPC message queue name - this prevents an interference with the IPC message queue (which is used for URI processing) when running a testnet and mainnet instance in parallel - to check for testnet, I had to raise the ParseParameters() call in main() to the topmost position --- src/qt/bitcoin.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/qt/bitcoin.cpp') diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index dbdfade0b..c3701ced7 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -113,6 +113,14 @@ static void handleRunawayException(std::exception *e) #ifndef BITCOIN_QT_TEST int main(int argc, char *argv[]) { + // Command-line options take precedence: + ParseParameters(argc, argv); + + if(GetBoolArg("-testnet")) // Separate message queue name for testnet + strBitcoinURIQueueName = BITCOINURI_QUEUE_NAME_TESTNET; + else + strBitcoinURIQueueName = BITCOINURI_QUEUE_NAME_MAINNET; + // Do this early as we don't want to bother initializing if we are just calling IPC ipcScanRelay(argc, argv); @@ -126,9 +134,6 @@ int main(int argc, char *argv[]) // Install global event filter that makes sure that long tooltips can be word-wrapped app.installEventFilter(new GUIUtil::ToolTipToRichTextFilter(TOOLTIP_WRAP_THRESHOLD, &app)); - // Command-line options take precedence: - ParseParameters(argc, argv); - // ... then bitcoin.conf: if (!boost::filesystem::is_directory(GetDataDir(false))) { -- cgit v1.2.3