Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/init.cpp
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | if (showDebug) { | ||||
strprintf(_("Wallet will not create transactions that violate " | strprintf(_("Wallet will not create transactions that violate " | ||||
"mempool chain limits (default: %d)"), | "mempool chain limits (default: %d)"), | ||||
DEFAULT_WALLET_REJECT_LONG_CHAINS)); | DEFAULT_WALLET_REJECT_LONG_CHAINS)); | ||||
} | } | ||||
return strUsage; | return strUsage; | ||||
} | } | ||||
bool WalletParameterInteraction() { | bool WalletParameterInteraction(Config &config) { | ||||
CFeeRate minRelayTxFee = GetConfig().GetMinFeePerKB(); | CFeeRate minRelayTxFee = config.GetMinFeePerKB(); | ||||
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)) { | if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) { | ||||
return true; | return true; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | if (gArgs.IsArgSet("-maxtxfee")) { | ||||
AmountErrMsg("maxtxfee", gArgs.GetArg("-maxtxfee", ""))); | AmountErrMsg("maxtxfee", gArgs.GetArg("-maxtxfee", ""))); | ||||
} | } | ||||
if (nMaxFee > HIGH_MAX_TX_FEE) { | if (nMaxFee > HIGH_MAX_TX_FEE) { | ||||
InitWarning(_("-maxtxfee is set very high! Fees this large could " | InitWarning(_("-maxtxfee is set very high! Fees this large could " | ||||
"be paid on a single transaction.")); | "be paid on a single transaction.")); | ||||
} | } | ||||
maxTxFee = nMaxFee; | config.SetMaxFee(nMaxFee); | ||||
if (CFeeRate(maxTxFee, 1000) < minRelayTxFee) { | if (CFeeRate(nMaxFee, 1000) < minRelayTxFee) { | ||||
deadalnix: You can have the setter return a bool and check that. | |||||
schancelAuthorUnsubmitted Done Inline ActionsSounds good schancel: Sounds good | |||||
return InitError(strprintf( | return InitError(strprintf( | ||||
_("Invalid amount for -maxtxfee=<amount>: '%s' (must " | _("Invalid amount for -maxtxfee=<amount>: '%s' (must " | ||||
"be at least the minrelay fee of %s to prevent " | "be at least the minrelay fee of %s to prevent " | ||||
"stuck transactions)"), | "stuck transactions)"), | ||||
gArgs.GetArg("-maxtxfee", ""), minRelayTxFee.ToString())); | gArgs.GetArg("-maxtxfee", ""), minRelayTxFee.ToString())); | ||||
} | } | ||||
} else { | |||||
config.SetMaxFee(DEFAULT_TRANSACTION_MAXFEE); | |||||
} | } | ||||
nTxConfirmTarget = | nTxConfirmTarget = | ||||
gArgs.GetArg("-txconfirmtarget", DEFAULT_TX_CONFIRM_TARGET); | gArgs.GetArg("-txconfirmtarget", DEFAULT_TX_CONFIRM_TARGET); | ||||
bSpendZeroConfChange = | bSpendZeroConfChange = | ||||
gArgs.GetBoolArg("-spendzeroconfchange", DEFAULT_SPEND_ZEROCONF_CHANGE); | gArgs.GetBoolArg("-spendzeroconfchange", DEFAULT_SPEND_ZEROCONF_CHANGE); | ||||
return true; | return true; | ||||
▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines |
You can have the setter return a bool and check that.