MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / AmountFromValue

Function AmountFromValue

src/rpc/util.cpp:98–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98CAmount AmountFromValue(const UniValue& value, int decimals)
99{
100 if (!value.isNum() && !value.isStr())
101 throw JSONRPCError(RPC_TYPE_ERROR, "Amount is not a number or string");
102 int64_t amount;
103 if (!ParseFixedPoint(value.getValStr(), decimals, &amount))
104 throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount");
105 if (!MoneyRange(amount))
106 throw JSONRPCError(RPC_TYPE_ERROR, "Amount out of range");
107 return amount;
108}
109
110CFeeRate ParseFeeRate(const UniValue& json)
111{

Callers 11

sendrawtransactionFunction · 0.70
submitpackageFunction · 0.70
ParseFeeRateFunction · 0.70
ParseOutputsFunction · 0.70
ParsePrevoutsFunction · 0.70
listunspentFunction · 0.50
SetFeeEstimateModeFunction · 0.50
FundTransactionFunction · 0.50
BOOST_AUTO_TEST_CASEFunction · 0.50
BOOST_AUTO_TEST_CASEFunction · 0.50
parse_univalue.cppFile · 0.50

Calls 5

JSONRPCErrorFunction · 0.85
ParseFixedPointFunction · 0.85
MoneyRangeFunction · 0.85
isNumMethod · 0.80
isStrMethod · 0.80

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.40
BOOST_AUTO_TEST_CASEFunction · 0.40