Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/init.cpp
Show First 20 Lines • Show All 217 Lines • ▼ Show 20 Lines | bool WalletInit::ParameterInteraction() const { | ||||
if (gArgs.GetArg("-prune", 0) && gArgs.GetBoolArg("-rescan", false)) { | if (gArgs.GetArg("-prune", 0) && gArgs.GetBoolArg("-rescan", false)) { | ||||
return InitError( | return InitError( | ||||
_("Rescans are not possible in pruned mode. You will need to use " | _("Rescans are not possible in pruned mode. You will need to use " | ||||
"-reindex which will download the whole blockchain again.") | "-reindex which will download the whole blockchain again.") | ||||
.translated); | .translated); | ||||
} | } | ||||
if (minRelayTxFee.GetFeePerK() > HIGH_TX_FEE_PER_KB) { | |||||
InitWarning( | |||||
AmountHighWarn("-minrelaytxfee") + " " + | |||||
_("The wallet will avoid paying less than the minimum relay fee.") | |||||
.translated); | |||||
} | |||||
if (gArgs.IsArgSet("-maxtxfee")) { | |||||
Amount nMaxFee = Amount::zero(); | |||||
if (!ParseMoney(gArgs.GetArg("-maxtxfee", ""), nMaxFee)) { | |||||
return InitError( | |||||
AmountErrMsg("maxtxfee", gArgs.GetArg("-maxtxfee", ""))); | |||||
} | |||||
if (nMaxFee > HIGH_MAX_TX_FEE) { | |||||
InitWarning(_("-maxtxfee is set very high! Fees this large could " | |||||
"be paid on a single transaction.") | |||||
.translated); | |||||
} | |||||
maxTxFee = nMaxFee; | |||||
if (CFeeRate(maxTxFee, 1000) < minRelayTxFee) { | |||||
return InitError(strprintf( | |||||
_("Invalid amount for -maxtxfee=<amount>: '%s' (must " | |||||
"be at least the minrelay fee of %s to prevent " | |||||
"stuck transactions)") | |||||
.translated, | |||||
gArgs.GetArg("-maxtxfee", ""), minRelayTxFee.ToString())); | |||||
} | |||||
} | |||||
return true; | return true; | ||||
} | } | ||||
void WalletInit::Construct(NodeContext &node) const { | void WalletInit::Construct(NodeContext &node) const { | ||||
if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) { | if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) { | ||||
LogPrintf("Wallet disabled!\n"); | LogPrintf("Wallet disabled!\n"); | ||||
return; | return; | ||||
} | } | ||||
gArgs.SoftSetArg("-wallet", ""); | gArgs.SoftSetArg("-wallet", ""); | ||||
node.chain_clients.emplace_back( | node.chain_clients.emplace_back( | ||||
interfaces::MakeWalletClient(*node.chain, gArgs.GetArgs("-wallet"))); | interfaces::MakeWalletClient(*node.chain, gArgs.GetArgs("-wallet"))); | ||||
} | } |