aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/util.h
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2021-04-27 10:54:44 +0200
committerJon Atack <jon@atack.com>2021-05-09 12:50:00 +0200
commit0742c7840f03505597fd2de87db97f12597ef667 (patch)
tree3ec1c0e2202c7b1d09902a7c203671aa5b9449aa /src/rpc/util.h
parent8ce3ef57a3e9ad13c0aaa4648e8584241d53592d (diff)
downloadbitcoin-0742c7840f03505597fd2de87db97f12597ef667.tar.xz
rpc: enable passing decimals to AmountFromValue, add doxygen
Diffstat (limited to 'src/rpc/util.h')
-rw-r--r--src/rpc/util.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rpc/util.h b/src/rpc/util.h
index 8ec18b2f35..41cbcc6032 100644
--- a/src/rpc/util.h
+++ b/src/rpc/util.h
@@ -77,7 +77,14 @@ extern uint256 ParseHashO(const UniValue& o, std::string strKey);
extern std::vector<unsigned char> ParseHexV(const UniValue& v, std::string strName);
extern std::vector<unsigned char> ParseHexO(const UniValue& o, std::string strKey);
-extern CAmount AmountFromValue(const UniValue& value);
+/**
+ * Validate and return a CAmount from a UniValue number or string.
+ *
+ * @param[in] value UniValue number or string to parse.
+ * @param[in] decimals Number of significant digits (default: 8).
+ * @returns a CAmount if the various checks pass.
+ */
+extern CAmount AmountFromValue(const UniValue& value, int decimals = 8);
using RPCArgList = std::vector<std::pair<std::string, UniValue>>;
extern std::string HelpExampleCli(const std::string& methodname, const std::string& args);