Auto merge of #2056 - str4d:2035-experimental-mode, r=bitcartel

Add a flag for enabling experimental features

Closes #2035.
This commit is contained in:
zkbot 2017-02-09 23:39:02 +00:00
commit 7d4ced95ed
6 changed files with 16 additions and 3 deletions

View File

@ -98,7 +98,7 @@ def main():
os.makedirs(options.tmpdir)
initialize_chain(options.tmpdir)
nodes = start_nodes(1, options.tmpdir, extra_args=[['-developerencryptwallet']])
nodes = start_nodes(1, options.tmpdir, extra_args=[['-experimentalfeatures', '-developerencryptwallet']])
run_test(nodes, options.tmpdir)

View File

@ -12,7 +12,7 @@ class WalletNullifiersTest (BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(4, self.options.tmpdir,
extra_args=[['-developerencryptwallet']] * 4)
extra_args=[['-experimentalfeatures', '-developerencryptwallet']] * 4)
def run_test (self):
# add zaddr to node 0

View File

@ -416,6 +416,7 @@ std::string HelpMessage(HelpMessageMode mode)
debugCategories += ", qt";
strUsage += HelpMessageOpt("-debug=<category>", strprintf(_("Output debugging information (default: %u, supplying <category> is optional)"), 0) + ". " +
_("If <category> is not supplied or if <category> = 1, output all debugging information.") + " " + _("<category> can be:") + " " + debugCategories + ".");
strUsage += HelpMessageOpt("-experimentalfeatures", _("Enable use of experimental features"));
strUsage += HelpMessageOpt("-help-debug", _("Show all debugging options (usage: --help -help-debug)"));
strUsage += HelpMessageOpt("-logips", strprintf(_("Include IP addresses in debug output (default: %u)"), 0));
strUsage += HelpMessageOpt("-logtimestamps", strprintf(_("Prepend debug output with timestamp (default: %u)"), 1));
@ -750,6 +751,16 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
// ********************************************************* Step 2: parameter interactions
const CChainParams& chainparams = Params();
// Set this early so that experimental features are correctly enabled/disabled
fExperimentalMode = GetBoolArg("-experimentalfeatures", false);
// Fail early if user has set experimental options without the global flag
if (!fExperimentalMode) {
if (mapArgs.count("-developerencryptwallet")) {
return InitError(_("Wallet encryption requires -experimentalfeatures."));
}
}
// Set this early so that parameter interactions go to console
fPrintToConsole = GetBoolArg("-printtoconsole", false);
fLogTimestamps = GetBoolArg("-logtimestamps", true);

View File

@ -56,6 +56,7 @@ int64_t nTimeBestReceived = 0;
CWaitableCriticalSection csBestBlock;
CConditionVariable cvBlockChange;
int nScriptCheckThreads = 0;
bool fExperimentalMode = false;
bool fImporting = false;
bool fReindex = false;
bool fTxIndex = false;

View File

@ -116,6 +116,7 @@ extern uint64_t nLastBlockSize;
extern const std::string strMessageMagic;
extern CWaitableCriticalSection csBestBlock;
extern CConditionVariable cvBlockChange;
extern bool fExperimentalMode;
extern bool fImporting;
extern bool fReindex;
extern int nScriptCheckThreads;

View File

@ -2002,7 +2002,7 @@ Value encryptwallet(const Array& params, bool fHelp)
if (!EnsureWalletIsAvailable(fHelp))
return Value::null;
auto fEnableWalletEncryption = GetBoolArg("-developerencryptwallet", false);
auto fEnableWalletEncryption = fExperimentalMode && GetBoolArg("-developerencryptwallet", false);
std::string strWalletEncryptionDisabledMsg = "";
if (!fEnableWalletEncryption) {