MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / ParameterInteraction

Method ParameterInteraction

src/wallet/init.cpp:89–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89bool WalletInit::ParameterInteraction() const
90{
91 if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) {
92 for (const std::string& wallet : gArgs.GetArgs("-wallet")) {
93 LogPrintf("%s: parameter interaction: -disablewallet -> ignoring -wallet=%s\n", __func__, wallet);
94 }
95
96 return true;
97 }
98
99 gArgs.SoftSetArg("-wallet", "");
100 const bool is_multiwallet = gArgs.GetArgs("-wallet").size() > 1;
101
102 if (gArgs.GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY) && gArgs.SoftSetBoolArg("-walletbroadcast", false)) {
103 LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__);
104 }
105
106 if (gArgs.GetBoolArg("-salvagewallet", false)) {
107 if (is_multiwallet) {
108 return InitError(strprintf("%s is only allowed with a single wallet file", "-salvagewallet"));
109 }
110 // Rewrite just private keys: rescan to find transactions
111 if (gArgs.SoftSetBoolArg("-rescan", true)) {
112 LogPrintf("%s: parameter interaction: -salvagewallet=1 -> setting -rescan=1\n", __func__);
113 }
114 }
115
116 bool zapwallettxes = gArgs.GetBoolArg("-zapwallettxes", false);
117 // -zapwallettxes implies dropping the mempool on startup
118 if (zapwallettxes && gArgs.SoftSetBoolArg("-persistmempool", false)) {
119 LogPrintf("%s: parameter interaction: -zapwallettxes enabled -> setting -persistmempool=0\n", __func__);
120 }
121
122 // -zapwallettxes implies a rescan
123 if (zapwallettxes) {
124 if (is_multiwallet) {
125 return InitError(strprintf("%s is only allowed with a single wallet file", "-zapwallettxes"));
126 }
127 if (gArgs.SoftSetBoolArg("-rescan", true)) {
128 LogPrintf("%s: parameter interaction: -zapwallettxes enabled -> setting -rescan=1\n", __func__);
129 }
130 }
131
132 if (is_multiwallet) {
133 if (gArgs.GetBoolArg("-upgradewallet", false)) {
134 return InitError(strprintf("%s is only allowed with a single wallet file", "-upgradewallet"));
135 }
136 }
137
138 if (gArgs.GetBoolArg("-sysperms", false))
139 return InitError("-sysperms is not allowed in combination with enabled wallet functionality");
140 if (gArgs.GetArg("-prune", 0) && gArgs.GetBoolArg("-rescan", false))
141 return InitError(_("Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again."));
142
143 if (::minRelayTxFee.GetFeePerK() > HIGH_TX_FEE_PER_KB)
144 InitWarning(AmountHighWarn("-minrelaytxfee") + " " +
145 _("The wallet will avoid paying less than the minimum relay fee."));
146

Callers

nothing calls this directly

Calls 15

InitErrorFunction · 0.85
_Function · 0.85
InitWarningFunction · 0.85
AmountHighWarnFunction · 0.85
ParseMoneyFunction · 0.85
AmountErrMsgFunction · 0.85
GetBoolArgMethod · 0.80
GetArgsMethod · 0.80
SoftSetArgMethod · 0.80
SoftSetBoolArgMethod · 0.80
GetFeePerKMethod · 0.80
IsArgSetMethod · 0.80

Tested by

no test coverage detected