Browse Source
Require -experimentalmode for wallet encryption
pull/4/head
Jack Grigg
7 years ago
No known key found for this signature in database
GPG Key ID: 6A6914DAFBEA00DA
4 changed files with
10 additions and
3 deletions
-
qa/rpc-tests/keypool.py
-
qa/rpc-tests/wallet_nullifiers.py
-
src/init.cpp
-
src/wallet/rpcwallet.cpp
|
|
@ -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) |
|
|
|
|
|
|
|
|
|
@ -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 |
|
|
|
|
|
@ -754,6 +754,13 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) |
|
|
|
// 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); |
|
|
|
|
|
@ -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) { |
|
|
|