Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/init.cpp
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
const WalletInitInterface &g_wallet_init_interface = WalletInit(); | const WalletInitInterface &g_wallet_init_interface = WalletInit(); | ||||
void WalletInit::AddWalletOptions() const { | void WalletInit::AddWalletOptions() const { | ||||
gArgs.AddArg("-disablewallet", | gArgs.AddArg("-disablewallet", | ||||
_("Do not load the wallet and disable wallet RPC calls"), | _("Do not load the wallet and disable wallet RPC calls"), | ||||
false, OptionsCategory::WALLET); | false, OptionsCategory::WALLET); | ||||
gArgs.AddArg("-keypool=<n>", | |||||
strprintf(_("Set key pool size to <n> (default: %u)"), | |||||
DEFAULT_KEYPOOL_SIZE), | |||||
false, OptionsCategory::WALLET); | |||||
gArgs.AddArg("-fallbackfee=<amt>", | gArgs.AddArg("-fallbackfee=<amt>", | ||||
strprintf(_("A fee rate (in %s/kB) that will be used when fee " | strprintf(_("A fee rate (in %s/kB) that will be used when fee " | ||||
"estimation has insufficient data (default: %s)"), | "estimation has insufficient data (default: %s)"), | ||||
CURRENCY_UNIT, FormatMoney(DEFAULT_FALLBACK_FEE)), | CURRENCY_UNIT, FormatMoney(DEFAULT_FALLBACK_FEE)), | ||||
false, OptionsCategory::WALLET); | false, OptionsCategory::WALLET); | ||||
gArgs.AddArg("-keypool=<n>", | |||||
strprintf(_("Set key pool size to <n> (default: %u)"), | |||||
DEFAULT_KEYPOOL_SIZE), | |||||
false, OptionsCategory::WALLET); | |||||
gArgs.AddArg( | |||||
"-maxtxfee=<amt>", | |||||
strprintf(_("Maximum total fees (in %s) to use in a single wallet " | |||||
"transaction or raw transaction; setting this too low may " | |||||
"abort large transactions (default: %s)"), | |||||
CURRENCY_UNIT, FormatMoney(DEFAULT_TRANSACTION_MAXFEE)), | |||||
false, OptionsCategory::DEBUG_TEST); | |||||
gArgs.AddArg("-mintxfee=<amt>", | |||||
strprintf(_("Fees (in %s/kB) smaller than this are considered " | |||||
"zero fee for transaction creation (default: %s)"), | |||||
CURRENCY_UNIT, | |||||
FormatMoney(DEFAULT_TRANSACTION_MINFEE_PER_KB)), | |||||
false, OptionsCategory::WALLET); | |||||
gArgs.AddArg( | gArgs.AddArg( | ||||
"-paytxfee=<amt>", | "-paytxfee=<amt>", | ||||
strprintf( | strprintf( | ||||
_("Fee (in %s/kB) to add to transactions you send (default: %s)"), | _("Fee (in %s/kB) to add to transactions you send (default: %s)"), | ||||
CURRENCY_UNIT, FormatMoney(payTxFee.GetFeePerK())), | CURRENCY_UNIT, FormatMoney(payTxFee.GetFeePerK())), | ||||
false, OptionsCategory::WALLET); | false, OptionsCategory::WALLET); | ||||
gArgs.AddArg( | gArgs.AddArg( | ||||
"-rescan", | "-rescan", | ||||
▲ Show 20 Lines • Show All 197 Lines • ▼ Show 20 Lines | if (gArgs.IsArgSet("-maxtxfee")) { | ||||
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())); | ||||
} | } | ||||
} | } | ||||
if (gArgs.IsArgSet("-mintxfee")) { | |||||
Amount n = Amount::zero(); | |||||
auto parsed = ParseMoney(gArgs.GetArg("-mintxfee", ""), n); | |||||
if (!parsed || n == Amount::zero()) { | |||||
return InitError( | |||||
AmountErrMsg("mintxfee", gArgs.GetArg("-mintxfee", ""))); | |||||
} | |||||
if (n > HIGH_TX_FEE_PER_KB) { | |||||
InitWarning(AmountHighWarn("-mintxfee") + " " + | |||||
_("This is the minimum transaction fee you pay on " | |||||
"every transaction.")); | |||||
} | |||||
CWallet::minTxFee = CFeeRate(n); | |||||
} | |||||
bSpendZeroConfChange = | bSpendZeroConfChange = | ||||
gArgs.GetBoolArg("-spendzeroconfchange", DEFAULT_SPEND_ZEROCONF_CHANGE); | gArgs.GetBoolArg("-spendzeroconfchange", DEFAULT_SPEND_ZEROCONF_CHANGE); | ||||
g_address_type = OutputType::DEFAULT; | g_address_type = OutputType::DEFAULT; | ||||
g_change_type = OutputType::DEFAULT; | g_change_type = OutputType::DEFAULT; | ||||
return true; | return true; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines |