Merge #11594: Improve -disablewallet parameter interaction
7963335
Fix -disablewallet default value (João Barbosa)b411c2a
Improve -disablewallet parameter interaction (João Barbosa) Pull request description: The first commit logs a message for each configured wallet if `-disablewallet` is set: ``` bitcoind -printtoconsole -regtest -disablewallet -wallet=foo -wallet=bar ... WalletParameterInteraction: parameter interaction: -disablewallet -> ignoring -wallet=foo WalletParameterInteraction: parameter interaction: -disablewallet -> ignoring -wallet=bar ``` It also moves up the `-disablewallet` check which avoids the unnecessary `-wallet` soft set. The second commit fixes the default value of `-disablewallet`, currently the value is correct, but it should use `DEFAULT_DISABLE_WALLET`. The third commit can be dropped or squashed, just took the opportunity to fix the coding style there. Tree-SHA512: bec13d2b2be5adf4680c77212020ed27dd05f15c4c73542d2005d91108bf704e2df1707ed2bec696e584ecd40eff7a63e25201fd70400222aa5a8da6aed6afeb
This commit is contained in:
commit
0ecc6305f4
1 changed files with 13 additions and 5 deletions
|
@ -53,12 +53,17 @@ std::string GetWalletHelpString(bool showDebug)
|
||||||
|
|
||||||
bool WalletParameterInteraction()
|
bool WalletParameterInteraction()
|
||||||
{
|
{
|
||||||
|
if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) {
|
||||||
|
for (const std::string& wallet : gArgs.GetArgs("-wallet")) {
|
||||||
|
LogPrintf("%s: parameter interaction: -disablewallet -> ignoring -wallet=%s\n", __func__, wallet);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
gArgs.SoftSetArg("-wallet", DEFAULT_WALLET_DAT);
|
gArgs.SoftSetArg("-wallet", DEFAULT_WALLET_DAT);
|
||||||
const bool is_multiwallet = gArgs.GetArgs("-wallet").size() > 1;
|
const bool is_multiwallet = gArgs.GetArgs("-wallet").size() > 1;
|
||||||
|
|
||||||
if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (gArgs.GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY) && gArgs.SoftSetBoolArg("-walletbroadcast", false)) {
|
if (gArgs.GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY) && gArgs.SoftSetBoolArg("-walletbroadcast", false)) {
|
||||||
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__);
|
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__);
|
||||||
}
|
}
|
||||||
|
@ -173,15 +178,18 @@ bool WalletParameterInteraction()
|
||||||
|
|
||||||
void RegisterWalletRPC(CRPCTable &t)
|
void RegisterWalletRPC(CRPCTable &t)
|
||||||
{
|
{
|
||||||
if (gArgs.GetBoolArg("-disablewallet", false)) return;
|
if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RegisterWalletRPCCommands(t);
|
RegisterWalletRPCCommands(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VerifyWallets()
|
bool VerifyWallets()
|
||||||
{
|
{
|
||||||
if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET))
|
if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
uiInterface.InitMessage(_("Verifying wallet(s)..."));
|
uiInterface.InitMessage(_("Verifying wallet(s)..."));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue