From 502926e44a8565b661b395d5955913b2f590cf86 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 13 Oct 2014 14:16:43 -0700 Subject: [PATCH] potential datadir option. --- src/bitcoindjs.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/bitcoindjs.cc b/src/bitcoindjs.cc index c3057719..ae86c341 100644 --- a/src/bitcoindjs.cc +++ b/src/bitcoindjs.cc @@ -609,6 +609,26 @@ start_node_thread(void) { boost::thread_group threadGroup; boost::thread *detectShutdownThread = NULL; + // XXX In case we ever want an option for a custom directory: +#if 0 + // Workaround for AppInit2() arg parsing. Not ideal, but it works. + int argc = 1; + char **argv = NULL; + if (dataDir) { + argc = 3; + argv = (char **)malloc((argc + 1) * sizeof(char **)); + argv[0] = "bitcoind"; + argv[1] = "-datadir"; + argv[2] = dataDir; + argv[3] = NULL; + } else { + argc = 1; + argv = (char **)malloc((argc + 1) * sizeof(char **)); + argv[0] = "bitcoind"; + argv[1] = NULL; + } +#endif + // Workaround for AppInit2() arg parsing. Not ideal, but it works. const int argc = 0; const char *argv[argc + 1] = { NULL };