strUsage += HelpMessageOpt("-disablewallet", _("Do not load the wallet and disable wallet RPC calls"));
+ strUsage += HelpMessageOpt("-disablehot", _("Disable the possibility of hot keys (only watchonlys are possible in this mode") + "" + strprintf(_("(default: %u)"), DEFAULT_DISABLE_HOT_WALLET));
strUsage += HelpMessageOpt("-keypool=<n>", strprintf(_("Set key pool size to <n> (default: %u)"), DEFAULT_KEYPOOL_SIZE));
strUsage += HelpMessageOpt("-fallbackfee=<amt>", strprintf(_("A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)"),
Indeed. Might be out of this PR matter, in the case of hdwatchonly, walletInstance->vchDefaultKey.IsValid() will be true. So this would mean disabledHot is incompatible with hdwatchonly mode ?
+ InitError(strprintf(_("Error loading %s: You can't enable hot keys once you have initialized a wallet with disabled hot keys (use -disablehot instead)"), walletFile));
This seems like the wrong error message: You can't disable hot keys... when the user has not specified the -disablehot parameter. Rather, this branch indicates some kind of wallet corruption: the DISABLE_HOT_KEYS flag is set, but the wallet contains private keys.
+ assert_raises_jsonrpc(-4,"Error: Hot keys are disabled (-disablehot)", self.nodes[1].getnewaddress)
+ assert_raises_jsonrpc(-4,"Error: Hot keys are disabled (-disablehot)", self.nodes[1].getrawchangeaddress)
+ assert_raises_jsonrpc(-4,"Error: Hot keys are disabled (-disablehot)", self.nodes[1].importprivkey, "92e6XLo5jVAVwrQKPNTs93oQco8f8sDNBcpv73Dsrs397fQtFQn")
+ assert_raises_jsonrpc(-4,"Error: Hot keys are disabled (-disablehot)", self.nodes[1].importwallet, "dummy")
+
+ self.nodes[1].importpubkey(n0pubkR) #TODO switch to importmulti
Maybe leave a comment here to make it clear there are two modes of detecting an initialized wallet here.