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 101 Lines • ▼ Show 20 Lines | if (gArgs.IsArgSet("-paytxfee")) { | ||||
if (payTxFee < minRelayTxFee) { | if (payTxFee < minRelayTxFee) { | ||||
return InitError(strprintf( | return InitError(strprintf( | ||||
_("Invalid amount for -paytxfee=<amount>: '%s' (must " | _("Invalid amount for -paytxfee=<amount>: '%s' (must " | ||||
"be at least %s)"), | "be at least %s)"), | ||||
gArgs.GetArg("-paytxfee", ""), minRelayTxFee.ToString())); | gArgs.GetArg("-paytxfee", ""), minRelayTxFee.ToString())); | ||||
} | } | ||||
} | } | ||||
config.SetMaxFee(DEFAULT_TRANSACTION_MAXFEE); | |||||
deadalnix: Remove and initialize the config as expected. | |||||
if (gArgs.IsArgSet("-maxtxfee")) { | if (gArgs.IsArgSet("-maxtxfee")) { | ||||
Amount nMaxFee = Amount::zero(); | Amount nMaxFee = Amount::zero(); | ||||
if (!ParseMoney(gArgs.GetArg("-maxtxfee", ""), nMaxFee)) { | if (!ParseMoney(gArgs.GetArg("-maxtxfee", ""), nMaxFee)) { | ||||
return InitError( | return InitError( | ||||
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; | if (!config.SetMaxFee(nMaxFee)) { | ||||
if (CFeeRate(maxTxFee, 1000) < minRelayTxFee) { | |||||
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())); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines |
Remove and initialize the config as expected.