Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 3,556 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("settxfee", "0.00001") + | HelpExampleCli("settxfee", "0.00001") + | ||||
HelpExampleRpc("settxfee", "0.00001")); | HelpExampleRpc("settxfee", "0.00001")); | ||||
} | } | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
Amount nAmount = AmountFromValue(request.params[0]); | Amount nAmount = AmountFromValue(request.params[0]); | ||||
CFeeRate tx_fee_rate(nAmount, 1000); | |||||
if (tx_fee_rate == CFeeRate()) { | |||||
// automatic selection | |||||
} else if (tx_fee_rate < ::minRelayTxFee) { | |||||
throw JSONRPCError( | |||||
RPC_INVALID_PARAMETER, | |||||
strprintf("txfee cannot be less than min relay tx fee (%s)", | |||||
::minRelayTxFee.ToString())); | |||||
} else if (tx_fee_rate < pwallet->m_min_fee) { | |||||
throw JSONRPCError( | |||||
RPC_INVALID_PARAMETER, | |||||
strprintf("txfee cannot be less than wallet min fee (%s)", | |||||
pwallet->m_min_fee.ToString())); | |||||
} | |||||
pwallet->m_pay_tx_fee = CFeeRate(nAmount, 1000); | pwallet->m_pay_tx_fee = tx_fee_rate; | ||||
return true; | return true; | ||||
} | } | ||||
static UniValue getwalletinfo(const Config &config, | static UniValue getwalletinfo(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
▲ Show 20 Lines • Show All 1,883 Lines • Show Last 20 Lines |