Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 1,890 Lines • ▼ Show 20 Lines | if (peer_connect_timeout <= 0) { | ||||
"peertimeout cannot be configured with a negative value."); | "peertimeout cannot be configured with a negative value."); | ||||
} | } | ||||
// Obtain the amount to charge excess UTXO | // Obtain the amount to charge excess UTXO | ||||
if (gArgs.IsArgSet("-excessutxocharge")) { | if (gArgs.IsArgSet("-excessutxocharge")) { | ||||
Amount n = Amount::zero(); | Amount n = Amount::zero(); | ||||
auto parsed = ParseMoney(gArgs.GetArg("-excessutxocharge", ""), n); | auto parsed = ParseMoney(gArgs.GetArg("-excessutxocharge", ""), n); | ||||
if (!parsed || Amount::zero() > n) { | if (!parsed || Amount::zero() > n) { | ||||
return InitError(AmountErrMsg( | return InitError(AmountErrMsg("excessutxocharge", | ||||
"excessutxocharge", gArgs.GetArg("-excessutxocharge", ""))); | gArgs.GetArg("-excessutxocharge", "")) | ||||
.translated); | |||||
} | } | ||||
config.SetExcessUTXOCharge(n); | config.SetExcessUTXOCharge(n); | ||||
} else { | } else { | ||||
config.SetExcessUTXOCharge(DEFAULT_UTXO_FEE); | config.SetExcessUTXOCharge(DEFAULT_UTXO_FEE); | ||||
} | } | ||||
if (gArgs.IsArgSet("-minrelaytxfee")) { | if (gArgs.IsArgSet("-minrelaytxfee")) { | ||||
Amount n = Amount::zero(); | Amount n = Amount::zero(); | ||||
auto parsed = ParseMoney(gArgs.GetArg("-minrelaytxfee", ""), n); | auto parsed = ParseMoney(gArgs.GetArg("-minrelaytxfee", ""), n); | ||||
if (!parsed || n == Amount::zero()) { | if (!parsed || n == Amount::zero()) { | ||||
return InitError(AmountErrMsg("minrelaytxfee", | return InitError(AmountErrMsg("minrelaytxfee", | ||||
gArgs.GetArg("-minrelaytxfee", ""))); | gArgs.GetArg("-minrelaytxfee", "")) | ||||
.translated); | |||||
} | } | ||||
// High fee check is done afterward in WalletParameterInteraction() | // High fee check is done afterward in WalletParameterInteraction() | ||||
::minRelayTxFee = CFeeRate(n); | ::minRelayTxFee = CFeeRate(n); | ||||
} | } | ||||
// Sanity check argument for min fee for including tx in block | // Sanity check argument for min fee for including tx in block | ||||
// TODO: Harmonize which arguments need sanity checking and where that | // TODO: Harmonize which arguments need sanity checking and where that | ||||
// happens. | // happens. | ||||
if (gArgs.IsArgSet("-blockmintxfee")) { | if (gArgs.IsArgSet("-blockmintxfee")) { | ||||
Amount n = Amount::zero(); | Amount n = Amount::zero(); | ||||
if (!ParseMoney(gArgs.GetArg("-blockmintxfee", ""), n)) { | if (!ParseMoney(gArgs.GetArg("-blockmintxfee", ""), n)) { | ||||
return InitError(AmountErrMsg("blockmintxfee", | return InitError(AmountErrMsg("blockmintxfee", | ||||
gArgs.GetArg("-blockmintxfee", ""))); | gArgs.GetArg("-blockmintxfee", "")) | ||||
.translated); | |||||
} | } | ||||
} | } | ||||
// Feerate used to define dust. Shouldn't be changed lightly as old | // Feerate used to define dust. Shouldn't be changed lightly as old | ||||
// implementations may inadvertently create non-standard transactions. | // implementations may inadvertently create non-standard transactions. | ||||
if (gArgs.IsArgSet("-dustrelayfee")) { | if (gArgs.IsArgSet("-dustrelayfee")) { | ||||
Amount n = Amount::zero(); | Amount n = Amount::zero(); | ||||
auto parsed = ParseMoney(gArgs.GetArg("-dustrelayfee", ""), n); | auto parsed = ParseMoney(gArgs.GetArg("-dustrelayfee", ""), n); | ||||
if (!parsed || Amount::zero() == n) { | if (!parsed || Amount::zero() == n) { | ||||
return InitError(AmountErrMsg("dustrelayfee", | return InitError( | ||||
gArgs.GetArg("-dustrelayfee", ""))); | AmountErrMsg("dustrelayfee", gArgs.GetArg("-dustrelayfee", "")) | ||||
.translated); | |||||
} | } | ||||
dustRelayFee = CFeeRate(n); | dustRelayFee = CFeeRate(n); | ||||
} | } | ||||
fRequireStandard = | fRequireStandard = | ||||
!gArgs.GetBoolArg("-acceptnonstdtxn", !chainparams.RequireStandard()); | !gArgs.GetBoolArg("-acceptnonstdtxn", !chainparams.RequireStandard()); | ||||
if (!chainparams.IsTestChain() && !fRequireStandard) { | if (!chainparams.IsTestChain() && !fRequireStandard) { | ||||
return InitError( | return InitError( | ||||
▲ Show 20 Lines • Show All 852 Lines • Show Last 20 Lines |