aboutsummaryrefslogtreecommitdiff
path: root/src/qt/intro.cpp
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2018-08-23 13:42:31 -0400
committerRussell Yanofsky <russ@yanofsky.org>2020-08-26 05:52:31 -0400
commite1336316250ab5cb0ed654b1e593378a6e0769ce (patch)
tree0c8c89dc5e462c8aae6d9b000cb3df159aaf48f5 /src/qt/intro.cpp
parenta12d9e5fd24a25bef476c10620317e43a5905754 (diff)
downloadbitcoin-e1336316250ab5cb0ed654b1e593378a6e0769ce.tar.xz
gui: Partially revert #10244 gArgs and Params changes
Change gui code to use gArgs, Params() functions directly instead of going through interfaces::Node. Remotely accessing bitcoin-node ArgsManager from bitcoin-gui works fine in https://github.com/bitcoin/bitcoin/pull/10102, when bitcoin-gui spawns a new bitcoin-node process and controls its startup, but for bitcoin-gui to support -ipcconnect option in https://github.com/bitcoin/bitcoin/pull/19461 and connect to an existing bitcoin-node process, it needs ability to parse arguments itself before connecting out. This change also simplifies https://github.com/bitcoin/bitcoin/pull/10102 a bit, by making the bitcoin-gui -> bitcoin-node startup sequence more similar to the bitcoin-node -> bitcoin-wallet startup sequence where the parent process parses arguments and passes them to the child process instead of the parent process using the child process to parse arguments.
Diffstat (limited to 'src/qt/intro.cpp')
-rw-r--r--src/qt/intro.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp
index ad21dfc3ef..fc5de74ffe 100644
--- a/src/qt/intro.cpp
+++ b/src/qt/intro.cpp
@@ -6,6 +6,7 @@
#include <config/bitcoin-config.h>
#endif
+#include <chainparams.h>
#include <fs.h>
#include <qt/intro.h>
#include <qt/forms/ui_intro.h>
@@ -199,13 +200,13 @@ bool Intro::showIfNeeded(interfaces::Node& node, bool& did_show_intro, bool& pru
{
/* Use selectParams here to guarantee Params() can be used by node interface */
try {
- node.selectParams(gArgs.GetChainName());
+ SelectParams(gArgs.GetChainName());
} catch (const std::exception&) {
return false;
}
/* If current default data directory does not exist, let the user choose one */
- Intro intro(0, node.getAssumedBlockchainSize(), node.getAssumedChainStateSize());
+ Intro intro(0, Params().AssumedBlockchainSize(), Params().AssumedChainStateSize());
intro.setDataDirectory(dataDir);
intro.setWindowIcon(QIcon(":icons/bitcoin"));
did_show_intro = true;
@@ -242,7 +243,7 @@ bool Intro::showIfNeeded(interfaces::Node& node, bool& did_show_intro, bool& pru
* (to be consistent with bitcoind behavior)
*/
if(dataDir != GUIUtil::getDefaultDataDirectory()) {
- node.softSetArg("-datadir", GUIUtil::qstringToBoostPath(dataDir).string()); // use OS locale for path setting
+ gArgs.SoftSetArg("-datadir", GUIUtil::qstringToBoostPath(dataDir).string()); // use OS locale for path setting
}
return true;
}