diff options
author | Philip Kaufmann <phil.kaufmann@t-online.de> | 2013-01-03 22:06:18 +0100 |
---|---|---|
committer | Philip Kaufmann <phil.kaufmann@t-online.de> | 2013-01-06 03:42:40 +0100 |
commit | 8ffbd6c3789843cb024a3ee425ac4cc0482eaeb7 (patch) | |
tree | 6c6ca803e1f6460f114720bf8473efea0f87087f /src/qt/bitcoin.cpp | |
parent | 1f4fdb70f0c5791a4742aa8f59fc42cff9740cfc (diff) |
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
Diffstat (limited to 'src/qt/bitcoin.cpp')
-rw-r--r-- | src/qt/bitcoin.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index dbdfade0b1..c3701ced7f 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))) { |