Page MenuHomePhabricator

D6064.diff
No OneTemporary

D6064.diff

diff --git a/src/rpc/abc.cpp b/src/rpc/abc.cpp
--- a/src/rpc/abc.cpp
+++ b/src/rpc/abc.cpp
@@ -39,8 +39,7 @@
"in the active chain or relayed. This discourages the propagation "
"of blocks that you consider excessively large.",
{
- {"blockSize", RPCArg::Type::NUM, /* opt */ false,
- /* default_value */ "",
+ {"blockSize", RPCArg::Type::NUM, RPCArg::Optional::NO,
"Excessive block size in bytes. Must be greater than " +
std::to_string(LEGACY_MAX_BLOCK_SIZE) + "."},
},
diff --git a/src/rpc/avalanche.cpp b/src/rpc/avalanche.cpp
--- a/src/rpc/avalanche.cpp
+++ b/src/rpc/avalanche.cpp
@@ -38,10 +38,10 @@
"addavalanchepeer",
"\nAdd a peer to the set of peer to poll for avalanche.\n",
{
- {"nodeid", RPCArg::Type::NUM, /* opt */ false,
- /* default_value */ "", "Node to be added to avalanche."},
- {"publickey", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_value */ "", "The public key of the node."},
+ {"nodeid", RPCArg::Type::NUM, RPCArg::Optional::NO,
+ "Node to be added to avalanche."},
+ {"publickey", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "The public key of the node."},
},
RPCResults{},
RPCExamples{HelpExampleRpc("addavalanchepeer", "5")},
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -229,8 +229,7 @@
"info about it.\n"
"\nReturns the current block on timeout or exit.\n",
{
- {"timeout", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "0",
+ {"timeout", RPCArg::Type::NUM, /* default */ "0",
"Time in milliseconds to wait for a response. 0 indicates no "
"timeout."},
},
@@ -282,10 +281,9 @@
"info about it.\n"
"\nReturns the current block on timeout or exit.\n",
{
- {"blockhash", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "Block hash to wait for."},
- {"timeout", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "0",
+ {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "Block hash to wait for."},
+ {"timeout", RPCArg::Type::NUM, /* default */ "0",
"Time in milliseconds to wait for a response. 0 "
"indicates no timeout."},
},
@@ -345,10 +343,9 @@
"height and hash\nof the current tip.\n"
"\nReturns the current block on timeout or exit.\n",
{
- {"height", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "", "Block height to wait for."},
- {"timeout", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "0",
+ {"height", RPCArg::Type::NUM, RPCArg::Optional::NO,
+ "Block height to wait for."},
+ {"timeout", RPCArg::Type::NUM, /* default */ "0",
"Time in milliseconds to wait for a response. 0 "
"indicates no timeout."},
},
@@ -565,8 +562,7 @@
"\nHint: use getmempoolentry to fetch a specific "
"transaction from the mempool.\n",
{
- {"verbose", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"verbose", RPCArg::Type::BOOL, /* default */ "false",
"True for a json object, false for array of "
"transaction ids"},
},
@@ -604,11 +600,9 @@
"\nIf txid is in the mempool, returns all in-mempool "
"ancestors.\n",
{
- {"txid", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "",
+ {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
"The transaction id (must be in mempool)"},
- {"verbose", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"verbose", RPCArg::Type::BOOL, /* default */ "false",
"True for a json object, false for array of "
"transaction ids"},
},
@@ -683,11 +677,9 @@
"\nIf txid is in the mempool, returns all in-mempool "
"descendants.\n",
{
- {"txid", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "",
+ {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
"The transaction id (must be in mempool)"},
- {"verbose", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"verbose", RPCArg::Type::BOOL, /* default */ "false",
"True for a json object, false for array of "
"transaction ids"},
},
@@ -759,8 +751,7 @@
"getmempoolentry",
"\nReturns mempool data for given transaction\n",
{
- {"txid", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "",
+ {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
"The transaction id (must be in mempool)"},
},
RPCResult{"{ (json object)\n" +
@@ -795,8 +786,8 @@
"\nReturns hash of block in best-block-chain at height "
"provided.\n",
{
- {"height", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "", "The height index"},
+ {"height", RPCArg::Type::NUM, RPCArg::Optional::NO,
+ "The height index"},
},
RPCResult{"\"hash\" (string) The block hash\n"},
RPCExamples{HelpExampleCli("getblockhash", "1000") +
@@ -827,10 +818,9 @@
"If verbose is true, returns an Object with information "
"about blockheader <hash>.\n",
{
- {"blockhash", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "The block hash"},
- {"verbose", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "true",
+ {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "The block hash"},
+ {"verbose", RPCArg::Type::BOOL, /* default */ "true",
"true for a json object, false for the hex-encoded data"},
},
{
@@ -941,10 +931,9 @@
"If verbosity is 2, returns an Object with information about "
"block <hash> and information about each transaction.\n",
{
- {"blockhash", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "The block hash"},
- {"verbosity", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "1",
+ {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "The block hash"},
+ {"verbosity", RPCArg::Type::NUM, /* default */ "1",
"0 for hex-encoded data, 1 for a json object, and 2 for "
"json object with transaction data"},
},
@@ -1051,8 +1040,7 @@
"pruneblockchain",
"",
{
- {"height", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "",
+ {"height", RPCArg::Type::NUM, RPCArg::Optional::NO,
"The block height to prune up to. May be set to a discrete "
"height, or a unix timestamp\n"
" to prune blocks whose block time is at "
@@ -1170,12 +1158,10 @@
"gettxout",
"\nReturns details about an unspent transaction output.\n",
{
- {"txid", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "The transaction id"},
- {"n", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "", "vout number"},
- {"include_mempool", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "true",
+ {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "The transaction id"},
+ {"n", RPCArg::Type::NUM, RPCArg::Optional::NO, "vout number"},
+ {"include_mempool", RPCArg::Type::BOOL, /* default */ "true",
"Whether to include the mempool. Note that an unspent "
"output that is spent in the mempool won't appear."},
},
@@ -1264,11 +1250,11 @@
"verifychain",
"\nVerifies blockchain database.\n",
{
- {"checklevel", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ strprintf("%d, range=0-4", nCheckLevel),
+ {"checklevel", RPCArg::Type::NUM,
+ /* default */ strprintf("%d, range=0-4", nCheckLevel),
"How thorough the block verification is."},
- {"nblocks", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ strprintf("%d, 0=all", nCheckDepth),
+ {"nblocks", RPCArg::Type::NUM,
+ /* default */ strprintf("%d, 0=all", nCheckDepth),
"The number of blocks to check."},
},
RPCResult{"true|false (boolean) Verified or not\n"},
@@ -1698,8 +1684,7 @@
"\nThe effects of preciousblock are not retained across "
"restarts.\n",
{
- {"blockhash", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "",
+ {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
"the hash of the block to mark as precious"},
},
RPCResults{},
@@ -1739,8 +1724,7 @@
"work chain, it can effectively PUTS YOU OUT OF CONSENSUS.\n"
"USE WITH CAUTION!\n",
{
- {"blockhash", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "",
+ {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
"the hash of the block to mark as invalid"},
},
RPCResults{},
@@ -1783,8 +1767,7 @@
"\nPermanently marks a block as invalid, as if it "
"violated a consensus rule.\n",
{
- {"blockhash", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "",
+ {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
"the hash of the block to mark as invalid"},
},
RPCResults{},
@@ -1824,8 +1807,8 @@
"parkblock",
"\nMarks a block as parked.\n",
{
- {"blockhash", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "the hash of the block to park"},
+ {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "the hash of the block to park"},
},
RPCResults{},
RPCExamples{HelpExampleCli("parkblock", "\"blockhash\"") +
@@ -1869,8 +1852,8 @@
"reconsider them for activation.\n"
"This can be used to undo the effects of invalidateblock.\n",
{
- {"blockhash", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "the hash of the block to reconsider"},
+ {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "the hash of the block to reconsider"},
},
RPCResults{},
RPCExamples{HelpExampleCli("reconsiderblock", "\"blockhash\"") +
@@ -1909,8 +1892,8 @@
"reconsider them for activation.\n"
"This can be used to undo the effects of parkblock.\n",
{
- {"blockhash", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "the hash of the block to unpark"},
+ {"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "the hash of the block to unpark"},
},
RPCResults{},
RPCExamples{HelpExampleCli("unparkblock", "\"blockhash\"") +
@@ -1950,11 +1933,9 @@
"\nCompute statistics about the total number and rate "
"of transactions in the chain.\n",
{
- {"nblocks", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "one month",
+ {"nblocks", RPCArg::Type::NUM, /* default */ "one month",
"Size of the window in number of blocks"},
- {"blockhash", RPCArg::Type::STR_HEX, /* opt */ true,
- /* default_val */ "chain tip",
+ {"blockhash", RPCArg::Type::STR_HEX, /* default */ "chain tip",
"The hash of the block that ends the window."},
},
RPCResult{
@@ -2086,21 +2067,19 @@
{
{"hash_or_height",
RPCArg::Type::NUM,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"The block hash or height of the target block",
"",
{"", "string or numeric"}},
{"stats",
RPCArg::Type::ARR,
- /* opt */ true,
- /* default_val */ "all values",
+ /* default */ "all values",
"Values to plot (see result below)",
{
- {"height", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "", "Selected statistic"},
- {"time", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "", "Selected statistic"},
+ {"height", RPCArg::Type::STR, RPCArg::Optional::OMITTED,
+ "Selected statistic"},
+ {"time", RPCArg::Type::STR, RPCArg::Optional::OMITTED,
+ "Selected statistic"},
},
"stats"},
},
@@ -2508,8 +2487,7 @@
"For more information on output descriptors, see the "
"documentation in the doc/descriptors.md file.\n",
{
- {"action", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"action", RPCArg::Type::STR, RPCArg::Optional::NO,
"The action to execute\n"
" \"start\" for "
"starting a scan\n"
@@ -2520,25 +2498,22 @@
"progress report (in %) of the current scan"},
{"scanobjects",
RPCArg::Type::ARR,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"Array of scan objects\n"
" Every scan object is "
"either a string descriptor or an object:",
{
- {"descriptor", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "", "An output descriptor"},
+ {"descriptor", RPCArg::Type::STR,
+ RPCArg::Optional::OMITTED, "An output descriptor"},
{
"",
RPCArg::Type::OBJ,
- /* opt */ true,
- /* default_val */ "",
+ RPCArg::Optional::OMITTED,
"An object with output descriptor and metadata",
{
- {"desc", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "An output descriptor"},
- {"range", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "1000",
+ {"desc", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "An output descriptor"},
+ {"range", RPCArg::Type::NUM, /* default */ "1000",
"Up to what child index HD chains should be "
"explored"},
},
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp
--- a/src/rpc/mining.cpp
+++ b/src/rpc/mining.cpp
@@ -97,12 +97,10 @@
"Pass in [height] to estimate the network speed at the "
"time when a certain block was found.\n",
{
- {"nblocks", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "120",
+ {"nblocks", RPCArg::Type::NUM, /* default */ "120",
"The number of blocks, or -1 for blocks since last "
"difficulty change."},
- {"height", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "-1",
+ {"height", RPCArg::Type::NUM, /* default */ "-1",
"To estimate at the time of the given height."},
},
RPCResult{"x (numeric) Hashes per second estimated\n"},
@@ -196,14 +194,12 @@
"\nMine blocks immediately to a specified address before the "
"RPC call returns)\n",
{
- {"nblocks", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "",
+ {"nblocks", RPCArg::Type::NUM, RPCArg::Optional::NO,
"How many blocks are generated immediately."},
- {"address", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"address", RPCArg::Type::STR, RPCArg::Optional::NO,
"The address to send the newly generated bitcoin to."},
- {"maxtries", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "1000000", "How many iterations to try."},
+ {"maxtries", RPCArg::Type::NUM, /* default */ "1000000",
+ "How many iterations to try."},
},
RPCResult{
"[ blockhashes ] (array) hashes of blocks generated\n"},
@@ -300,16 +296,15 @@
"Accepts the transaction into mined blocks at a higher "
"(or lower) priority\n",
{
- {"txid", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "The transaction id."},
- {"dummy", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "null",
+ {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "The transaction id."},
+ {"dummy", RPCArg::Type::NUM,
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"API-Compatibility for previous API. Must be zero or "
"null.\n"
" DEPRECATED. For forward compatibility "
"use named arguments and omit this parameter."},
- {"fee_delta", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "",
+ {"fee_delta", RPCArg::Type::NUM, RPCArg::Optional::NO,
"The fee value (in satoshis) to add (or subtract, if "
"negative).\n"
" The fee is not actually paid, "
@@ -389,23 +384,22 @@
{
{"template_request",
RPCArg::Type::OBJ,
- /* opt */ true,
- /* default_val */ "",
+ "{}",
"A json object in the following spec",
{
- {"mode", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "",
+ {"mode", RPCArg::Type::STR, /* treat as named arg */
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"This must be set to \"template\", \"proposal\" (see "
"BIP 23), or omitted"},
{
"capabilities",
RPCArg::Type::ARR,
- /* opt */ true,
- /* default_val */ "",
+ /* treat as named arg */
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"A list of strings",
{
- {"support", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "",
+ {"support", RPCArg::Type::STR,
+ RPCArg::Optional::OMITTED,
"client side supported feature, 'longpoll', "
"'coinbasetxn', 'coinbasevalue', 'proposal', "
"'serverlist', 'workid'"},
@@ -753,10 +747,9 @@
"See https://en.bitcoin.it/wiki/BIP_0022 for full "
"specification.\n",
{
- {"hexdata", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "the hex-encoded block data to submit"},
- {"dummy", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "ignored",
+ {"hexdata", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "the hex-encoded block data to submit"},
+ {"dummy", RPCArg::Type::STR, /* default */ "ignored",
"dummy value, for compatibility with BIP22. This value is "
"ignored."},
},
@@ -824,8 +817,8 @@
"candidate chain tip if valid."
"\nThrows when the header is invalid.\n",
{
- {"hexdata", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "the hex-encoded block header data"},
+ {"hexdata", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "the hex-encoded block header data"},
},
RPCResult{"None"},
RPCExamples{HelpExampleCli("submitheader", "\"aabbcc\"") +
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp
--- a/src/rpc/misc.cpp
+++ b/src/rpc/misc.cpp
@@ -39,8 +39,8 @@
"validateaddress",
"\nReturn information about the given bitcoin address.\n",
{
- {"address", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The bitcoin address to validate"},
+ {"address", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The bitcoin address to validate"},
},
RPCResult{
"{\n"
@@ -96,17 +96,16 @@
"keys required.\n"
"It returns a json object with the address and redeemScript.\n",
{
- {"nrequired", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "",
+ {"nrequired", RPCArg::Type::NUM, RPCArg::Optional::NO,
"The number of required signatures out of the n keys."},
{"keys",
RPCArg::Type::ARR,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"A json array of hex-encoded public keys.",
{
- {"key", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "The hex-encoded public key"},
+ {"key", RPCArg::Type::STR_HEX,
+ RPCArg::Optional::OMITTED,
+ "The hex-encoded public key"},
}},
},
RPCResult{"{\n"
@@ -193,14 +192,17 @@
"a hardened child key.\n"
"For more information on output descriptors, see the "
"documentation in the doc/descriptors.md file.\n"},
- {{"descriptor", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The descriptor."},
- {"begin", RPCArg::Type::NUM, /* opt */ true, /* default_val */ "",
- "If a ranged descriptor is used, this specifies the beginning of "
- "the range to import."},
- {"end", RPCArg::Type::NUM, /* opt */ true, /* default_val */ "",
- "If a ranged descriptor is used, this specifies the end of the "
- "range to import."}},
+ {
+ {"descriptor", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The descriptor."},
+ {"begin", RPCArg::Type::NUM,
+ RPCArg::Optional::OMITTED_NAMED_ARG,
+ "If a ranged descriptor is used, this specifies the beginning "
+ "of the range to import."},
+ {"end", RPCArg::Type::NUM, RPCArg::Optional::OMITTED_NAMED_ARG,
+ "If a ranged descriptor is used, this specifies the end of "
+ "the range to import."},
+ },
RPCResult{"[ address ] (array) the derived addresses\n"},
RPCExamples{
"First three native segwit receive addresses\n" +
@@ -294,15 +296,13 @@
"verifymessage",
"\nVerify a signed message\n",
{
- {"address", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"address", RPCArg::Type::STR, RPCArg::Optional::NO,
"The bitcoin address to use for the signature."},
- {"signature", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"signature", RPCArg::Type::STR, RPCArg::Optional::NO,
"The signature provided by the signer in base 64 encoding "
"(see signmessage)."},
- {"message", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The message that was signed."},
+ {"message", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The message that was signed."},
},
RPCResult{"true|false (boolean) If the signature is verified or "
"not.\n"},
@@ -371,11 +371,10 @@
"signmessagewithprivkey",
"\nSign a message with the private key of an address\n",
{
- {"privkey", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"privkey", RPCArg::Type::STR, RPCArg::Optional::NO,
"The private key to sign the message with."},
- {"message", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The message to create a signature of."},
+ {"message", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The message to create a signature of."},
},
RPCResult{"\"signature\" (string) The signature of the "
"message encoded in base 64\n"},
@@ -421,8 +420,7 @@
"setmocktime",
"\nSet the local time to given timestamp (-regtest only)\n",
{
- {"timestamp", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "",
+ {"timestamp", RPCArg::Type::NUM, RPCArg::Optional::NO,
"Unix seconds-since-epoch timestamp\n"
" Pass 0 to go back to using the system time."},
},
@@ -495,8 +493,7 @@
"getmemoryinfo",
"Returns an object containing information about memory usage.\n",
{
- {"mode", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "\"stats\"",
+ {"mode", RPCArg::Type::STR, /* default */ "\"stats\"",
"determines what kind of information is returned.\n"
" - \"stats\" returns general statistics about memory usage "
"in the daemon.\n"
@@ -595,23 +592,19 @@
{
{"include",
RPCArg::Type::ARR,
- /* opt */ true,
- /* default_val */ "null",
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"A json array of categories to add debug logging",
{
{"include_category", RPCArg::Type::STR,
- /* opt */ false, /* default_val */ "",
- "the valid logging category"},
+ RPCArg::Optional::OMITTED, "the valid logging category"},
}},
{"exclude",
RPCArg::Type::ARR,
- /* opt */ true,
- /* default_val */ "null",
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"A json array of categories to remove debug logging",
{
{"exclude_category", RPCArg::Type::STR,
- /* opt */ false, /* default_val */ "",
- "the valid logging category"},
+ RPCArg::Optional::OMITTED, "the valid logging category"},
}},
},
RPCResult{"{ (json object where keys are the "
diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp
--- a/src/rpc/net.cpp
+++ b/src/rpc/net.cpp
@@ -272,10 +272,9 @@
"full nodes as other outbound peers are (though such peers "
"will not be synced from).\n",
{
- {"node", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The node (see getpeerinfo for nodes)"},
- {"command", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"node", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The node (see getpeerinfo for nodes)"},
+ {"command", RPCArg::Type::STR, RPCArg::Optional::NO,
"'add' to add a node to the list, 'remove' to remove a "
"node from the list, 'onetry' to try a connection to the "
"node once"},
@@ -327,11 +326,11 @@
"\nTo disconnect by nodeid, either set 'address' to the empty "
"string, or call using the named 'nodeid' argument only.\n",
{
- {"address", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "fallback to nodeid",
+ {"address", RPCArg::Type::STR,
+ /* default */ "fallback to nodeid",
"The IP address/port of the node"},
- {"nodeid", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "fallback to address",
+ {"nodeid", RPCArg::Type::NUM,
+ /* default */ "fallback to address",
"The node ID (see getpeerinfo for node IDs)"},
},
RPCResults{},
@@ -386,8 +385,7 @@
"all added nodes\n"
"(note that onetry addnodes are not listed here)\n",
{
- {"node", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "all nodes",
+ {"node", RPCArg::Type::STR, /* default */ "all nodes",
"If provided, return information about this specific node, "
"otherwise all nodes are returned."},
},
@@ -664,22 +662,18 @@
"\nAttempts to add or remove an IP/Subnet from the "
"banned list.\n",
{
- {"subnet", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"subnet", RPCArg::Type::STR, RPCArg::Optional::NO,
"The IP/Subnet (see getpeerinfo for nodes IP) with an "
"optional netmask (default is /32 = single IP)"},
- {"command", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"command", RPCArg::Type::STR, RPCArg::Optional::NO,
"'add' to add an IP/Subnet to the list, 'remove' to "
"remove an IP/Subnet from the list"},
- {"bantime", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "0",
+ {"bantime", RPCArg::Type::NUM, /* default */ "0",
"time in seconds how long (or until when if [absolute] is "
"set) the IP is banned (0 or empty means using the default "
"time of 24h which can also be overwritten by the -bantime "
"startup argument)"},
- {"absolute", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"absolute", RPCArg::Type::BOOL, /* default */ "false",
"If set, the bantime must be an absolute timestamp in seconds "
"since epoch (Jan 1 1970 GMT)"},
},
@@ -824,8 +818,7 @@
"setnetworkactive",
"\nDisable/enable all p2p network activity.\n",
{
- {"state", RPCArg::Type::BOOL, /* opt */ false,
- /* default_val */ "",
+ {"state", RPCArg::Type::BOOL, RPCArg::Optional::NO,
"true to enable networking, false to disable"},
},
RPCResults{},
@@ -853,8 +846,7 @@
"\nReturn known addresses which can potentially be used "
"to find new nodes in the network\n",
{
- {"count", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "1",
+ {"count", RPCArg::Type::NUM, /* default */ "1",
"How many addresses to return. Limited to the "
"smaller of " +
std::to_string(ADDRMAN_GETADDR_MAX) + " or " +
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -89,14 +89,13 @@
"If verbose is 'false' or omitted, returns a string that is "
"serialized, hex-encoded data for 'txid'.\n",
{
- {"txid", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "The transaction id"},
- {"verbose", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "The transaction id"},
+ {"verbose", RPCArg::Type::BOOL, /* default */ "false",
"If false, return a string, otherwise return a json "
"object"},
- {"blockhash", RPCArg::Type::STR_HEX, /* opt */ true,
- /* default_val */ "null",
+ {"blockhash", RPCArg::Type::STR_HEX,
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"The block in which to look for the transaction"},
},
{
@@ -274,16 +273,15 @@
{
"txids",
RPCArg::Type::ARR,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"A json array of txids to filter",
{
- {"txid", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "A transaction hash"},
+ {"txid", RPCArg::Type::STR_HEX,
+ RPCArg::Optional::OMITTED, "A transaction hash"},
},
},
- {"blockhash", RPCArg::Type::STR_HEX, /* opt */ true,
- /* default_val */ "null",
+ {"blockhash", RPCArg::Type::STR_HEX,
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"If specified, looks for txid in the block with this hash"},
},
RPCResult{"\"data\" (string) A string that is a "
@@ -392,8 +390,7 @@
"and throwing an RPC error if the block is not in our "
"best chain\n",
{
- {"proof", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "",
+ {"proof", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
"The hex-encoded proof generated by gettxoutproof"},
},
RPCResult{"[\"txid\"] (array, strings) The txid(s) which the "
@@ -452,24 +449,20 @@
{
"inputs",
RPCArg::Type::ARR,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"A json array of json objects",
{
{
"",
RPCArg::Type::OBJ,
- /* opt */ true,
- /* default_val */ "",
+ RPCArg::Optional::OMITTED,
"",
{
{"txid", RPCArg::Type::STR_HEX,
- /* opt */ false, /* default_val */ "",
- "The transaction id"},
- {"vout", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "", "The output number"},
- {"sequence", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */
+ RPCArg::Optional::NO, "The transaction id"},
+ {"vout", RPCArg::Type::NUM,
+ RPCArg::Optional::NO, "The output number"},
+ {"sequence", RPCArg::Type::NUM, /* default */
"depends on the value of the 'locktime' "
"argument",
"The sequence number"},
@@ -480,8 +473,7 @@
{
"outputs",
RPCArg::Type::ARR,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"a json array with outputs (key-value pairs).\n"
"For compatibility reasons, a dictionary, which holds "
"the key-value pairs directly, is also\n"
@@ -491,12 +483,11 @@
{
"",
RPCArg::Type::OBJ,
- /* opt */ true,
- /* default_val */ "",
+ RPCArg::Optional::OMITTED,
"",
{
{"address", RPCArg::Type::AMOUNT,
- /* opt */ false, /* default_val */ "",
+ RPCArg::Optional::NO,
"A key-value pair. The key (string) is "
"the bitcoin address, the value (float or "
"string) is the amount in " +
@@ -506,20 +497,18 @@
{
"",
RPCArg::Type::OBJ,
- /* opt */ true,
- /* default_val */ "",
+ RPCArg::Optional::OMITTED,
"",
{
{"data", RPCArg::Type::STR_HEX,
- /* opt */ false, /* default_val */ "",
+ RPCArg::Optional::NO,
"A key-value pair. The key must be "
"\"data\", the value is hex-encoded data"},
},
},
},
},
- {"locktime", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "0",
+ {"locktime", RPCArg::Type::NUM, /* default */ "0",
"Raw locktime. Non-0 value also locktime-activates "
"inputs"},
},
@@ -563,8 +552,8 @@
"\nReturn a JSON object representing the serialized, "
"hex-encoded transaction.\n",
{
- {"hexstring", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "The transaction hex string"},
+ {"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "The transaction hex string"},
},
RPCResult{
"{\n"
@@ -638,8 +627,8 @@
"decodescript",
"\nDecode a hex-encoded script.\n",
{
- {"hexstring", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "the hex-encoded script"},
+ {"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "the hex-encoded script"},
},
RPCResult{"{\n"
" \"asm\":\"asm\", (string) Script public key\n"
@@ -700,14 +689,12 @@
{
"txs",
RPCArg::Type::ARR,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"A json array of hex strings of partially signed "
"transactions",
{
{"hexstring", RPCArg::Type::STR_HEX,
- /* opt */ false, /* default_val */ "",
- "A transaction hash"},
+ RPCArg::Optional::OMITTED, "A transaction hash"},
},
},
},
@@ -803,54 +790,47 @@
"this transaction depends on but may not yet be in the block "
"chain.\n",
{
- {"hexstring", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "The transaction hex string"},
+ {"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "The transaction hex string"},
{
"privkeys",
RPCArg::Type::ARR,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"A json array of base58-encoded private keys for signing",
{
{"privatekey", RPCArg::Type::STR,
- /* opt */ false, /* default_val */ "",
+ RPCArg::Optional::OMITTED,
"private key in base58-encoding"},
},
},
{
"prevtxs",
RPCArg::Type::ARR,
- /* opt */ true,
- /* default_val */ "null",
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"A json array of previous dependent transaction outputs",
{
{
"",
RPCArg::Type::OBJ,
- /* opt */ true,
- /* default_val */ "",
+ RPCArg::Optional::OMITTED,
"",
{
{"txid", RPCArg::Type::STR_HEX,
- /* opt */ false, /* default_val */ "",
- "The transaction id"},
- {"vout", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "", "The output number"},
+ RPCArg::Optional::NO, "The transaction id"},
+ {"vout", RPCArg::Type::NUM,
+ RPCArg::Optional::NO, "The output number"},
{"scriptPubKey", RPCArg::Type::STR_HEX,
- /* opt */ false, /* default_val */ "",
- "script key"},
+ RPCArg::Optional::NO, "script key"},
{"redeemScript", RPCArg::Type::STR_HEX,
- /* opt */ true, /* default_val */ "omitted",
+ RPCArg::Optional::OMITTED,
"(required for P2SH) redeem script"},
{"amount", RPCArg::Type::AMOUNT,
- /* opt */ false, /* default_val */ "",
- "The amount spent"},
+ RPCArg::Optional::NO, "The amount spent"},
},
},
},
},
- {"sighashtype", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "ALL|FORKID",
+ {"sighashtype", RPCArg::Type::STR, /* default */ "ALL|FORKID",
"The signature hash type. Must be one of:\n"
" \"ALL|FORKID\"\n"
" \"NONE|FORKID\"\n"
@@ -924,10 +904,10 @@
"\nAlso see createrawtransaction and "
"signrawtransactionwithkey calls.\n",
{
- {"hexstring", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "The hex string of the raw transaction"},
- {"allowhighfees", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false", "Allow high fees"},
+ {"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "The hex string of the raw transaction"},
+ {"allowhighfees", RPCArg::Type::BOOL, /* default */ "false",
+ "Allow high fees"},
},
RPCResult{
"\"hex\" (string) The transaction hash in hex\n"},
@@ -988,18 +968,17 @@
{
"rawtxs",
RPCArg::Type::ARR,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"An array of hex strings of raw transactions.\n"
" Length must be "
"one for now.",
{
{"rawtx", RPCArg::Type::STR_HEX,
- /* opt */ false, /* default_val */ "", ""},
+ RPCArg::Optional::OMITTED, ""},
},
},
- {"allowhighfees", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false", "Allow high fees"},
+ {"allowhighfees", RPCArg::Type::BOOL, /* default */ "false",
+ "Allow high fees"},
},
RPCResult{
"[ (array) The result of the mempool "
@@ -1104,8 +1083,8 @@
"\nReturn a JSON object representing the serialized, "
"base64-encoded partially signed Bitcoin transaction.\n",
{
- {"psbt", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The PSBT base64 string"},
+ {"psbt", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The PSBT base64 string"},
},
RPCResult{
"{\n"
@@ -1387,13 +1366,12 @@
{
"txs",
RPCArg::Type::ARR,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"A json array of base64 strings of partially signed "
"transactions",
{
- {"psbt", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "A base64 string of a PSBT"},
+ {"psbt", RPCArg::Type::STR, RPCArg::Optional::OMITTED,
+ "A base64 string of a PSBT"},
},
},
},
@@ -1447,10 +1425,9 @@
"inputs that are complete.\n"
"Implements the Finalizer and Extractor roles.\n",
{
- {"psbt", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "A base64 string of a PSBT"},
- {"extract", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "true",
+ {"psbt", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "A base64 string of a PSBT"},
+ {"extract", RPCArg::Type::BOOL, /* default */ "true",
"If true and the transaction is complete,\n"
" extract and return the complete "
"transaction in normal network serialization instead of the "
@@ -1518,24 +1495,20 @@
{
"inputs",
RPCArg::Type::ARR,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"A json array of json objects",
{
{
"",
RPCArg::Type::OBJ,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::OMITTED,
"",
{
{"txid", RPCArg::Type::STR_HEX,
- /* opt */ false, /* default_val */ "",
- "The transaction id"},
- {"vout", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "", "The output number"},
- {"sequence", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */
+ RPCArg::Optional::NO, "The transaction id"},
+ {"vout", RPCArg::Type::NUM,
+ RPCArg::Optional::NO, "The output number"},
+ {"sequence", RPCArg::Type::NUM, /* default */
"depends on the value of the 'locktime' "
"argument",
"The sequence number"},
@@ -1546,8 +1519,7 @@
{
"outputs",
RPCArg::Type::ARR,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"a json array with outputs (key-value pairs).\n"
"For compatibility reasons, a dictionary, which holds "
"the key-value pairs directly, is also\n"
@@ -1557,12 +1529,11 @@
{
"",
RPCArg::Type::OBJ,
- /* opt */ true,
- /* default_val */ "",
+ RPCArg::Optional::OMITTED,
"",
{
{"address", RPCArg::Type::AMOUNT,
- /* opt */ false, /* default_val */ "",
+ RPCArg::Optional::NO,
"A key-value pair. The key (string) is "
"the bitcoin address, the value (float or "
"string) is the amount in " +
@@ -1572,20 +1543,18 @@
{
"",
RPCArg::Type::OBJ,
- /* opt */ true,
- /* default_val */ "",
+ RPCArg::Optional::OMITTED,
"",
{
{"data", RPCArg::Type::STR_HEX,
- /* opt */ false, /* default_val */ "",
+ RPCArg::Optional::NO,
"A key-value pair. The key must be "
"\"data\", the value is hex-encoded data"},
},
},
},
},
- {"locktime", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "0",
+ {"locktime", RPCArg::Type::NUM, /* default */ "0",
"Raw locktime. Non-0 value also locktime-activates inputs"},
},
RPCResult{" \"psbt\" (string) The resulting raw "
@@ -1638,10 +1607,9 @@
"createpsbt and walletcreatefundedpsbt should be used for new "
"applications.\n",
{
- {"hexstring", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "The hex string of a raw transaction"},
- {"permitsigdata", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "The hex string of a raw transaction"},
+ {"permitsigdata", RPCArg::Type::BOOL, /* default */ "false",
"If true, any signatures in the input will be discarded and "
"conversion.\n"
" will continue. If false, RPC "
@@ -1702,8 +1670,7 @@
"utxoupdatepsbt",
"\nUpdates a PSBT with witness UTXOs retrieved from the UTXO set "
"or the mempool.\n",
- {{"psbt", RPCArg::Type::STR,
- /* opt */ false, /* default_val */ "",
+ {{"psbt", RPCArg::Type::STR, RPCArg::Optional::NO,
"A base64 string of a PSBT"}},
RPCResult{" \"psbt\" (string) The base64-encoded "
"partially signed transaction with inputs updated\n"},
@@ -1766,11 +1733,10 @@
"PSBTs.\n",
{{"txs",
RPCArg::Type::ARR,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"A json array of base64 strings of partially signed transactions",
- {{"psbt", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "A base64 string of a PSBT"}}}},
+ {{"psbt", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "A base64 string of a PSBT"}}}},
RPCResult{" \"psbt\" (string) The base64-encoded "
"partially signed transaction\n"},
RPCExamples{HelpExampleCli("joinpsbts", "\"psbt\"")}}
@@ -1843,7 +1809,7 @@
"analyzepsbt",
"\nAnalyzes and provides information about the current status of a "
"PSBT and its inputs\n",
- {{"psbt", RPCArg::Type::STR, /* opt */ false, /* default_var */ "",
+ {{"psbt", RPCArg::Type::STR, RPCArg::Optional::NO,
"A base64 string of a PSBT"}},
RPCResult{
"{\n"
diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp
--- a/src/rpc/server.cpp
+++ b/src/rpc/server.cpp
@@ -182,8 +182,7 @@
"help",
"\nList all commands, or get help for a specified command.\n",
{
- {"command", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "all commands",
+ {"command", RPCArg::Type::STR, /* default */ "all commands",
"The command to get help on"},
},
RPCResult{"\"text\" (string) The help text\n"},
diff --git a/src/rpc/util.h b/src/rpc/util.h
--- a/src/rpc/util.h
+++ b/src/rpc/util.h
@@ -11,6 +11,8 @@
#include <univalue.h>
#include <util/check.h>
+#include <boost/variant.hpp>
+
#include <string>
#include <vector>
@@ -102,13 +104,33 @@
//! Special type that is a STR with only hex chars
STR_HEX,
};
+
+ enum class Optional {
+ /** Required arg */
+ NO,
+ /**
+ * Optinal arg that is a named argument and has a default value of
+ * `null`. When possible, the default value should be specified.
+ */
+ OMITTED_NAMED_ARG,
+ /**
+ * Optional argument with default value omitted because they are
+ * implicitly clear. That is, elements in an array or object may not
+ * exist by default.
+ * When possible, the default value should be specified.
+ */
+ OMITTED,
+ };
+ using Fallback =
+ boost::variant<Optional,
+ /* default value for optional args */ std::string>;
+
//! The name of the arg (can be empty for inner args)
const std::string m_name;
const Type m_type;
//! Only used for arrays or dicts
const std::vector<RPCArg> m_inner;
- const bool m_optional;
- const std::string m_default_value; //!< Only used for optional args
+ const Fallback m_fallback;
const std::string m_description;
//! Should be empty unless it is supposed to override the auto-generated
//! summary line
@@ -121,23 +143,22 @@
//! override the type in the argument description.
const std::vector<std::string> m_type_str;
- RPCArg(const std::string &name, const Type &type, const bool opt,
- const std::string &default_val, const std::string &description,
+ RPCArg(const std::string &name, const Type &type, const Fallback &fallback,
+ const std::string &description,
const std::string &oneline_description = "",
const std::vector<std::string> &type_str = {})
- : m_name{name}, m_type{type}, m_optional{opt},
- m_default_value{default_val}, m_description{description},
+ : m_name{name}, m_type{type}, m_fallback{fallback},
+ m_description{description},
m_oneline_description{oneline_description}, m_type_str{type_str} {
CHECK_NONFATAL(type != Type::ARR && type != Type::OBJ);
}
- RPCArg(const std::string &name, const Type &type, const bool opt,
- const std::string &default_val, const std::string &description,
- const std::vector<RPCArg> &inner,
+ RPCArg(const std::string &name, const Type &type, const Fallback &fallback,
+ const std::string &description, const std::vector<RPCArg> &inner,
const std::string &oneline_description = "",
const std::vector<std::string> &type_str = {})
- : m_name{name}, m_type{type}, m_inner{inner}, m_optional{opt},
- m_default_value{default_val}, m_description{description},
+ : m_name{name}, m_type{type}, m_inner{inner}, m_fallback{fallback},
+ m_description{description},
m_oneline_description{oneline_description}, m_type_str{type_str} {
CHECK_NONFATAL(type == Type::ARR || type == Type::OBJ);
}
@@ -156,10 +177,8 @@
/**
* Return the description string, including the argument type and whether
* the argument is required.
- * implicitly_required is set for arguments in an array, which are neither
- * optional nor required.
*/
- std::string ToDescriptionString(bool implicitly_required = false) const;
+ std::string ToDescriptionString() const;
};
struct RPCResult {
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp
--- a/src/rpc/util.cpp
+++ b/src/rpc/util.cpp
@@ -318,19 +318,14 @@
: arg.ToString(/* oneline */ false);
}
left += ",";
- PushSection({left, arg.ToDescriptionString(
- /* implicitly_required */ outer_type ==
- OuterType::ARR)});
+ PushSection({left, arg.ToDescriptionString()});
break;
}
case RPCArg::Type::OBJ:
case RPCArg::Type::OBJ_USER_KEYS: {
- const auto right =
- outer_type == OuterType::NAMED_ARG
- ? ""
- : arg.ToDescriptionString(
- /* implicitly_required */ outer_type ==
- OuterType::ARR);
+ const auto right = outer_type == OuterType::NAMED_ARG
+ ? ""
+ : arg.ToDescriptionString();
PushSection({indent + "{", right});
for (const auto &arg_inner : arg.m_inner) {
Push(arg_inner, current_indent + 2, OuterType::OBJ);
@@ -350,12 +345,9 @@
? "\"" + arg.m_name + "\": "
: "";
left += "[";
- const auto right =
- outer_type == OuterType::NAMED_ARG
- ? ""
- : arg.ToDescriptionString(
- /* implicitly_required */ outer_type ==
- OuterType::ARR);
+ const auto right = outer_type == OuterType::NAMED_ARG
+ ? ""
+ : arg.ToDescriptionString();
PushSection({left, right});
for (const auto &arg_inner : arg.m_inner) {
Push(arg_inner, current_indent + 2, OuterType::ARR);
@@ -447,8 +439,15 @@
ret += m_name;
bool was_optional{false};
for (const auto &arg : m_args) {
+ bool optional;
+ if (arg.m_fallback.which() == 1) {
+ optional = true;
+ } else {
+ optional = RPCArg::Optional::NO !=
+ boost::get<RPCArg::Optional>(arg.m_fallback);
+ }
ret += " ";
- if (arg.m_optional) {
+ if (optional) {
if (!was_optional) {
ret += "( ";
}
@@ -499,7 +498,7 @@
return ret;
}
-std::string RPCArg::ToDescriptionString(const bool implicitly_required) const {
+std::string RPCArg::ToDescriptionString() const {
std::string ret;
ret += "(";
if (m_type_str.size() != 0) {
@@ -536,21 +535,25 @@
// no default case, so the compiler can warn about missing cases
}
}
- if (!implicitly_required) {
- ret += ", ";
- if (m_optional) {
- ret += "optional";
- if (!m_default_value.empty()) {
- ret += ", default=" + m_default_value;
- } else {
- // TODO enable this assert, when all optional parameters have
- // their default value documented
- // assert(false);
+ if (m_fallback.which() == 1) {
+ ret += ", optional, default=" + boost::get<std::string>(m_fallback);
+ } else {
+ switch (boost::get<RPCArg::Optional>(m_fallback)) {
+ case RPCArg::Optional::OMITTED: {
+ // nothing to do. Element is treated as if not present and has
+ // no default value
+ break;
}
- } else {
- ret += "required";
- // Default value is ignored, and must not be present
- assert(m_default_value.empty());
+ case RPCArg::Optional::OMITTED_NAMED_ARG: {
+ ret += ", optional"; // Default value is "null"
+ break;
+ }
+ case RPCArg::Optional::NO: {
+ ret += ", required";
+ break;
+ }
+
+ // no default case, so the compiler can warn about missing cases
}
}
ret += ")";
diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp
--- a/src/wallet/rpcdump.cpp
+++ b/src/wallet/rpcdump.cpp
@@ -113,14 +113,12 @@
"are still missing, leading to temporarily incorrect/bogus "
"balances and unspent outputs until rescan completes.\n",
{
- {"privkey", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The private key (see dumpprivkey)"},
- {"label", RPCArg::Type::STR, /* opt */ true,
- /* default_val */
+ {"privkey", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The private key (see dumpprivkey)"},
+ {"label", RPCArg::Type::STR, /* default */
"current label if address exists, otherwise \"\"",
"An optional label"},
- {"rescan", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "true",
+ {"rescan", RPCArg::Type::BOOL, /* default */ "true",
"Rescan the wallet for transactions"},
},
RPCResults{},
@@ -323,16 +321,13 @@
"outputs sending to it will be treated\n"
"as change, and not show up in many RPCs.\n",
{
- {"address", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"address", RPCArg::Type::STR, RPCArg::Optional::NO,
"The Bitcoin address (or hex-encoded script)"},
- {"label", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "\"\"", "An optional label"},
- {"rescan", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "true",
+ {"label", RPCArg::Type::STR, /* default */ "\"\"",
+ "An optional label"},
+ {"rescan", RPCArg::Type::BOOL, /* default */ "true",
"Rescan the wallet for transactions"},
- {"p2sh", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"p2sh", RPCArg::Type::BOOL, /* default */ "false",
"Add the P2SH version of the script as well"},
},
RPCResults{},
@@ -425,12 +420,10 @@
"rescan after the point in the blockchain the transaction is "
"included.\n",
{
- {"rawtransaction", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "",
+ {"rawtransaction", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
"A raw transaction in hex funding an already-existing "
"address in wallet"},
- {"txoutproof", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "",
+ {"txoutproof", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
"The hex output from gettxoutproof that contains the "
"transaction"},
},
@@ -510,8 +503,7 @@
"for use with pruned wallets and as a companion to "
"importprunedfunds. This will affect wallet balances.\n",
{
- {"txid", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "",
+ {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
"The hex-encoded id of the transaction you are deleting"},
},
RPCResults{},
@@ -571,12 +563,11 @@
"incorrect/bogus balances and unspent outputs until rescan "
"completes.\n",
{
- {"pubkey", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The hex-encoded public key"},
- {"label", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "\"\"", "An optional label"},
- {"rescan", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "true",
+ {"pubkey", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The hex-encoded public key"},
+ {"label", RPCArg::Type::STR, /* default */ "\"\"",
+ "An optional label"},
+ {"rescan", RPCArg::Type::BOOL, /* default */ "true",
"Rescan the wallet for transactions"},
},
RPCResults{},
@@ -657,8 +648,8 @@
"\nImports keys from a wallet dump file (see dumpwallet). "
"Requires a new wallet backup to include imported keys.\n",
{
- {"filename", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The wallet file"},
+ {"filename", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The wallet file"},
},
RPCResults{},
RPCExamples{"\nDump the wallet\n" +
@@ -862,8 +853,7 @@
"\nReveals the private key corresponding to 'address'.\n"
"Then the importprivkey can be used with this output\n",
{
- {"address", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"address", RPCArg::Type::STR, RPCArg::Optional::NO,
"The bitcoin address for the private key"},
},
RPCResult{"\"key\" (string) The private key\n"},
@@ -920,8 +910,7 @@
"only backing up the seed itself, and must be backed up "
"too (e.g. ensure you back up the whole dumpfile).\n",
{
- {"filename", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"filename", RPCArg::Type::STR, RPCArg::Optional::NO,
"The filename with path (either absolute or relative to "
"bitcoind)"},
},
@@ -1598,26 +1587,23 @@
{
{"requests",
RPCArg::Type::ARR,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"Data to be imported",
{
{
"",
RPCArg::Type::OBJ,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::OMITTED,
"",
{
- {"desc", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "",
+ {"desc", RPCArg::Type::STR,
+ RPCArg::Optional::OMITTED,
"Descriptor to import. If using descriptor, do "
"not also provide address/scriptPubKey, scripts, "
"or pubkeys"},
{"scriptPubKey",
RPCArg::Type::STR,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"Type of scriptPubKey (string for script, json "
"for address). Should not be provided if using a "
"descriptor",
@@ -1626,8 +1612,7 @@
"string / json"}},
{"timestamp",
RPCArg::Type::NUM,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"Creation time of the key in seconds since "
"epoch (Jan 1 1970 GMT),\n"
" "
@@ -1652,59 +1637,55 @@
"be scanned.",
/* oneline_description */ "",
{"timestamp | \"now\"", "integer / string"}},
- {"redeemscript", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "omitted",
+ {"redeemscript", RPCArg::Type::STR,
+ RPCArg::Optional::OMITTED,
"Allowed only if the scriptPubKey is a P2SH "
"address/scriptPubKey"},
{"pubkeys",
RPCArg::Type::ARR,
- /* opt */ true,
- /* default_val */ "empty array",
+ /* default */ "empty array",
"Array of strings giving pubkeys to import. They "
"must occur in P2PKH scripts. They are not "
"required when the private key is also provided "
"(see the \"keys\" argument).",
{
- {"pubKey", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", ""},
+ {"pubKey", RPCArg::Type::STR,
+ RPCArg::Optional::OMITTED, ""},
}},
{"keys",
RPCArg::Type::ARR,
- /* opt */ true,
- /* default_val */ "empty array",
+ /* default */ "empty array",
"Array of strings giving private keys to import. "
"The corresponding public keys must occur in the "
"output or redeemscript.",
{
{"key", RPCArg::Type::STR,
- /* opt */ false, /* default_val */ "", ""},
+ RPCArg::Optional::OMITTED, ""},
}},
{"range",
RPCArg::Type::OBJ,
- /* opt */ true,
- /* default_val */ "",
+ RPCArg::Optional::OMITTED,
"If a ranged descriptor is used, this specifies "
"the start and end of the range to import",
{
- {"start", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "0",
+ {"start", RPCArg::Type::NUM,
+ /* default */ "0",
"Start of the range to import"},
- {"end", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "",
+ {"end", RPCArg::Type::NUM,
+ RPCArg::Optional::NO,
"End of the range to import (inclusive)"},
}},
{"internal", RPCArg::Type::BOOL,
- /* opt */ true, /* default_val */ "false",
+ /* default */ "false",
"Stating whether matching outputs should be "
"treated as not incoming payments (also known as "
"change)"},
{"watchonly", RPCArg::Type::BOOL,
- /* opt */ true, /* default_val */ "false",
+ /* default */ "false",
"Stating whether matching outputs should be "
"considered watched even when not all private "
"keys are provided."},
- {"label", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "''",
+ {"label", RPCArg::Type::STR, /* default */ "''",
"Label to assign to the address, only "
"allowed with internal=false"},
},
@@ -1713,12 +1694,10 @@
"\"requests\""},
{"options",
RPCArg::Type::OBJ,
- /* opt */ true,
- /* default_val */ "null",
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"",
{
- {"rescan", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "true",
+ {"rescan", RPCArg::Type::BOOL, /* default */ "true",
"Stating if should rescan the blockchain after all "
"imports"},
},
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -168,8 +168,7 @@
"so payments received with the address will be associated with "
"'label'.\n",
{
- {"label", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "null",
+ {"label", RPCArg::Type::STR, /* default */ "null",
"The label name for the address to be linked to. If not "
"provided, the default label \"\" is used. It can also be set "
"to the empty string \"\" to represent the default label. The "
@@ -310,11 +309,10 @@
"setlabel",
"\nSets the label associated with the given address.\n",
{
- {"address", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"address", RPCArg::Type::STR, RPCArg::Optional::NO,
"The bitcoin address to be associated with a label."},
- {"label", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The label to assign to the address."},
+ {"label", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The label to assign to the address."},
},
RPCResults{},
RPCExamples{
@@ -421,25 +419,24 @@
"\nSend an amount to a given address.\n" +
HelpRequiringPassphrase(pwallet) + "\n",
{
- {"address", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The bitcoin address to send to."},
- {"amount", RPCArg::Type::AMOUNT, /* opt */ false,
- /* default_val */ "",
+ {"address", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The bitcoin address to send to."},
+ {"amount", RPCArg::Type::AMOUNT, RPCArg::Optional::NO,
"The amount in " + CURRENCY_UNIT + " to send. eg 0.1"},
- {"comment", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "null",
+ {"comment", RPCArg::Type::STR,
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"A comment used to store what the transaction is for.\n"
" This is not part of the "
"transaction, just kept in your wallet."},
- {"comment_to", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "null",
+ {"comment_to", RPCArg::Type::STR,
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"A comment to store the name of the person or organization\n"
" to which you're sending the "
"transaction. This is not part of the \n"
" transaction, just kept in "
"your wallet."},
{"subtractfeefromamount", RPCArg::Type::BOOL,
- /* opt */ true, /* default_val */ "false",
+ /* default */ "false",
"The fee will be deducted from the amount being sent.\n"
" The recipient will receive "
"less bitcoins than you enter in the amount field."},
@@ -587,11 +584,10 @@
"\nSign a message with the private key of an address" +
HelpRequiringPassphrase(pwallet) + "\n",
{
- {"address", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"address", RPCArg::Type::STR, RPCArg::Optional::NO,
"The bitcoin address to use for the private key."},
- {"message", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The message to create a signature of."},
+ {"message", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The message to create a signature of."},
},
RPCResult{
"\"signature\" (string) The signature of the message "
@@ -668,10 +664,9 @@
"\nReturns the total amount received by the given address in "
"transactions with at least minconf confirmations.\n",
{
- {"address", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The bitcoin address for transactions."},
- {"minconf", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "1",
+ {"address", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The bitcoin address for transactions."},
+ {"minconf", RPCArg::Type::NUM, /* default */ "1",
"Only include transactions confirmed at least this many "
"times."},
},
@@ -761,12 +756,10 @@
"\nReturns the total amount received by addresses with <label> "
"in transactions with at least [minconf] confirmations.\n",
{
- {"label", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"label", RPCArg::Type::STR, RPCArg::Optional::NO,
"The selected label, may be the default label "
"using \"\"."},
- {"minconf", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "1",
+ {"minconf", RPCArg::Type::NUM, /* default */ "1",
"Only include transactions confirmed at least this "
"many times."},
},
@@ -847,16 +840,15 @@
"thus affected by options which limit spendability such "
"as -spendzeroconfchange.\n",
{
- {"dummy", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "null",
+ {"dummy", RPCArg::Type::STR,
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"Remains for backward compatibility. Must be excluded or set "
"to \"*\"."},
- {"minconf", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "0",
+ {"minconf", RPCArg::Type::NUM, /* default */ "0",
"Only include transactions confirmed at least this "
"many times."},
{"include_watchonly", RPCArg::Type::BOOL,
- /* opt */ true, /* default_val */ "false",
+ /* default */ "false",
"Also include balance in watch-only addresses (see "
"'importaddress')"},
},
@@ -947,34 +939,29 @@
"floating point numbers." +
HelpRequiringPassphrase(pwallet) + "\n",
{
- {"dummy", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"dummy", RPCArg::Type::STR, RPCArg::Optional::NO,
"Must be set to \"\" for backwards compatibility.", "\"\""},
{
"amounts",
RPCArg::Type::OBJ,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"A json object with addresses and amounts",
{
- {"address", RPCArg::Type::AMOUNT, /* opt */ false,
- /* default_val */ "",
+ {"address", RPCArg::Type::AMOUNT, RPCArg::Optional::NO,
"The bitcoin address is the key, the numeric "
"amount (can be string) in " +
CURRENCY_UNIT + " is the value"},
},
},
- {"minconf", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "1",
+ {"minconf", RPCArg::Type::NUM, /* default */ "1",
"Only use the balance confirmed at least this many "
"times."},
- {"comment", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "null", "A comment"},
+ {"comment", RPCArg::Type::STR,
+ RPCArg::Optional::OMITTED_NAMED_ARG, "A comment"},
{
"subtractfeefrom",
RPCArg::Type::ARR,
- /* opt */ true,
- /* default_val */ "null",
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"A json array with addresses.\n"
" The fee will be equally "
"deducted from the amount of each selected address.\n"
@@ -984,8 +971,8 @@
" If no addresses are "
"specified here, the sender pays the fee.",
{
- {"address", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "",
+ {"address", RPCArg::Type::STR,
+ RPCArg::Optional::OMITTED,
"Subtract fee from this address"},
},
},
@@ -1160,25 +1147,23 @@
"If 'label' is specified (DEPRECATED), assign address to that "
"label.\n",
{
- {"nrequired", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "",
+ {"nrequired", RPCArg::Type::NUM, RPCArg::Optional::NO,
"The number of required signatures out of the n keys or "
"addresses."},
{
"keys",
RPCArg::Type::ARR,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"A json array of bitcoin addresses or hex-encoded "
"public keys",
{
- {"key", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"key", RPCArg::Type::STR,
+ RPCArg::Optional::OMITTED,
"bitcoin address or hex-encoded public key"},
},
},
- {"label", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "null",
+ {"label", RPCArg::Type::STR,
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"A label to assign the addresses to."},
},
RPCResult{"{\n"
@@ -1420,20 +1405,17 @@
"listreceivedbyaddress",
"\nList balances by receiving address.\n",
{
- {"minconf", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "1",
+ {"minconf", RPCArg::Type::NUM, /* default */ "1",
"The minimum number of confirmations before payments are "
"included."},
- {"include_empty", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"include_empty", RPCArg::Type::BOOL, /* default */ "false",
"Whether to include addresses that haven't received any "
"payments."},
- {"include_watchonly", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"include_watchonly", RPCArg::Type::BOOL, /* default */ "false",
"Whether to include watch-only addresses (see "
"'importaddress')."},
- {"address_filter", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "null",
+ {"address_filter", RPCArg::Type::STR,
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"If present, only return information on this address."},
},
RPCResult{
@@ -1494,16 +1476,14 @@
"listreceivedbylabel",
"\nList received transactions by label.\n",
{
- {"minconf", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "1",
+ {"minconf", RPCArg::Type::NUM, /* default */ "1",
"The minimum number of confirmations before "
"payments are included."},
- {"include_empty", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"include_empty", RPCArg::Type::BOOL, /* default */ "false",
"Whether to include labels that haven't received "
"any payments."},
{"include_watchonly", RPCArg::Type::BOOL,
- /* opt */ true, /* default_val */ "false",
+ /* default */ "false",
"Whether to include watch-only addresses (see "
"'importaddress')."},
},
@@ -1651,18 +1631,16 @@
"\nReturns up to 'count' most recent transactions skipping the "
"first 'from' transactions.\n",
{
- {"label", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "null",
+ {"label", RPCArg::Type::STR,
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"If set, should be a valid label name to return only incoming "
"transactions with the specified label, or \"*\" to disable "
"filtering and return all transactions."},
- {"count", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "10",
+ {"count", RPCArg::Type::NUM, /* default */ "10",
"The number of transactions to return"},
- {"skip", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "0", "The number of transactions to skip"},
- {"include_watchonly", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"skip", RPCArg::Type::NUM, /* default */ "0",
+ "The number of transactions to skip"},
+ {"include_watchonly", RPCArg::Type::BOOL, /* default */ "false",
"Include transactions to watch-only addresses (see "
"'importaddress')"},
},
@@ -1831,22 +1809,19 @@
"the wallet which were removed are returned in the \"removed\" "
"array.\n",
{
- {"blockhash", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "null",
+ {"blockhash", RPCArg::Type::STR,
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"If set, the block hash to list transactions since, otherwise "
"list all transactions."},
- {"target_confirmations", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "1",
+ {"target_confirmations", RPCArg::Type::NUM, /* default */ "1",
"Return the nth block hash from the main chain. e.g. 1 "
"would mean the best block hash. Note: this is not used "
"as a filter, but only affects [lastblock] in the return "
"value"},
- {"include_watchonly", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"include_watchonly", RPCArg::Type::BOOL, /* default */ "false",
"Include transactions to watch-only addresses (see "
"'importaddress')"},
- {"include_removed", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "true",
+ {"include_removed", RPCArg::Type::BOOL, /* default */ "true",
"Show transactions that were removed due to a reorg in "
"the \"removed\" array\n"
" "
@@ -2043,10 +2018,10 @@
"\nGet detailed information about in-wallet transaction "
"<txid>\n",
{
- {"txid", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The transaction id"},
+ {"txid", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The transaction id"},
{"include_watchonly", RPCArg::Type::BOOL,
- /* opt */ true, /* default_val */ "false",
+ /* default */ "false",
"Whether to include watch-only addresses in "
"balance calculation and details[]"},
},
@@ -2194,8 +2169,8 @@
"and are not currently in the mempool.\n"
"It has no effect on transactions which are already abandoned.\n",
{
- {"txid", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "The transaction id"},
+ {"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "The transaction id"},
},
RPCResults{},
RPCExamples{HelpExampleCli("abandontransaction",
@@ -2247,8 +2222,8 @@
"\nSafely copies current wallet file to destination, "
"which can be a directory or a path with filename.\n",
{
- {"destination", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The destination directory or file"},
+ {"destination", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The destination directory or file"},
},
RPCResults{},
RPCExamples{HelpExampleCli("backupwallet", "\"backup.dat\"") +
@@ -2286,8 +2261,8 @@
"keypoolrefill",
"\nFills the keypool." + HelpRequiringPassphrase(pwallet) + "\n",
{
- {"newsize", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "100", "The new keypool size"},
+ {"newsize", RPCArg::Type::NUM, /* default */ "100",
+ "The new keypool size"},
},
RPCResults{},
RPCExamples{HelpExampleCli("keypoolrefill", "") +
@@ -2352,10 +2327,9 @@
"unlocked will set a new unlock\n"
"time that overrides the old one.\n",
{
- {"passphrase", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The wallet passphrase"},
- {"timeout", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "",
+ {"passphrase", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The wallet passphrase"},
+ {"timeout", RPCArg::Type::NUM, RPCArg::Optional::NO,
"The time to keep the decryption key in seconds; capped "
"at 100000000 (~3 years)."},
},
@@ -2442,10 +2416,10 @@
"\nChanges the wallet passphrase from 'oldpassphrase' to "
"'newpassphrase'.\n",
{
- {"oldpassphrase", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The current passphrase"},
- {"newpassphrase", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The new passphrase"},
+ {"oldpassphrase", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The current passphrase"},
+ {"newpassphrase", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The new passphrase"},
},
RPCResults{},
RPCExamples{HelpExampleCli("walletpassphrasechange",
@@ -2571,8 +2545,7 @@
"If the wallet is already encrypted, use the "
"walletpassphrasechange call.\n",
{
- {"passphrase", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"passphrase", RPCArg::Type::STR, RPCArg::Optional::NO,
"The pass phrase to encrypt the wallet with. It must be "
"at least 1 character, but should be long."},
},
@@ -2653,30 +2626,26 @@
"or fails.\n"
"Also see the listunspent call\n",
{
- {"unlock", RPCArg::Type::BOOL, /* opt */ false,
- /* default_val */ "",
+ {"unlock", RPCArg::Type::BOOL, RPCArg::Optional::NO,
"Whether to unlock (true) or lock (false) the specified "
"transactions"},
{
"transactions",
RPCArg::Type::ARR,
- /* opt */ true,
- /* default_val */ "empty array",
+ /* default */ "empty array",
"A json array of objects. Each object the txid (string) "
"vout (numeric).",
{
{
"",
RPCArg::Type::OBJ,
- /* opt */ true,
- /* default_val */ "",
+ RPCArg::Optional::OMITTED,
"",
{
{"txid", RPCArg::Type::STR_HEX,
- /* opt */ false, /* default_val */ "",
- "The transaction id"},
- {"vout", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "", "The output number"},
+ RPCArg::Optional::NO, "The transaction id"},
+ {"vout", RPCArg::Type::NUM,
+ RPCArg::Optional::NO, "The output number"},
},
},
},
@@ -2882,8 +2851,7 @@
"\nSet the transaction fee per kB for this wallet. Overrides the "
"global -paytxfee command line parameter.\n",
{
- {"amount", RPCArg::Type::AMOUNT, /* opt */ false,
- /* default_val */ "",
+ {"amount", RPCArg::Type::AMOUNT, RPCArg::Optional::NO,
"The transaction fee in " + CURRENCY_UNIT + "/kB"},
},
RPCResult{
@@ -3099,8 +3067,8 @@
"\napplied to the new wallet (eg -zapwallettxes, upgradewallet, "
"rescan, etc).\n",
{
- {"filename", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The wallet directory or .dat file."},
+ {"filename", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The wallet directory or .dat file."},
},
RPCResult{"{\n"
" \"name\" : <wallet_name>, (string) The "
@@ -3154,16 +3122,14 @@
"createwallet",
"\nCreates and loads a new wallet.\n",
{
- {"wallet_name", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"wallet_name", RPCArg::Type::STR, RPCArg::Optional::NO,
"The name for the new wallet. If this is a path, "
"the wallet will be created at the path location."},
{"disable_private_keys", RPCArg::Type::BOOL,
- /* opt */ true, /* default_val */ "false",
+ /* default */ "false",
"Disable the possibility of private keys (only "
"watchonlys are possible in this mode)."},
- {"blank", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"blank", RPCArg::Type::BOOL, /* default */ "false",
"Create a blank wallet. A blank wallet has no keys "
"or HD seed. One can be set using sethdseed.\n"},
},
@@ -3234,8 +3200,8 @@
"otherwise unloads the wallet specified in the argument.\n"
"Specifying the wallet name on a wallet endpoint is invalid.",
{
- {"wallet_name", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "the wallet name from the RPC request",
+ {"wallet_name", RPCArg::Type::STR,
+ /* default */ "the wallet name from the RPC request",
"The name of the wallet to unload."},
},
RPCResults{},
@@ -3290,43 +3256,38 @@
"Optionally filter to only include txouts paid to specified "
"addresses.\n",
{
- {"minconf", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "1", "The minimum confirmations to filter"},
- {"maxconf", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "9999999",
+ {"minconf", RPCArg::Type::NUM, /* default */ "1",
+ "The minimum confirmations to filter"},
+ {"maxconf", RPCArg::Type::NUM, /* default */ "9999999",
"The maximum confirmations to filter"},
{
"addresses",
RPCArg::Type::ARR,
- /* opt */ true,
- /* default_val */ "empty array",
+ /* default */ "empty array",
"A json array of bitcoin addresses to filter",
{
- {"address", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "", "bitcoin address"},
+ {"address", RPCArg::Type::STR,
+ RPCArg::Optional::OMITTED, "bitcoin address"},
},
},
- {"include_unsafe", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "true",
+ {"include_unsafe", RPCArg::Type::BOOL, /* default */ "true",
"Include outputs that are not safe to spend\n"
" See description of \"safe\" attribute "
"below."},
{"query_options",
RPCArg::Type::OBJ,
- /* opt */ true,
- /* default_val */ "null",
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"JSON with query options",
{
- {"minimumAmount", RPCArg::Type::AMOUNT, /* opt */ true,
- /* default_val */ "0",
+ {"minimumAmount", RPCArg::Type::AMOUNT, /* default */ "0",
"Minimum value of each UTXO in " + CURRENCY_UNIT + ""},
- {"maximumAmount", RPCArg::Type::AMOUNT, /* opt */ true,
- /* default_val */ "unlimited",
+ {"maximumAmount", RPCArg::Type::AMOUNT,
+ /* default */ "unlimited",
"Maximum value of each UTXO in " + CURRENCY_UNIT + ""},
- {"maximumCount", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "unlimited", "Maximum number of UTXOs"},
+ {"maximumCount", RPCArg::Type::NUM,
+ /* default */ "unlimited", "Maximum number of UTXOs"},
{"minimumSumAmount", RPCArg::Type::AMOUNT,
- /* opt */ true, /* default_val */ "unlimited",
+ /* default */ "unlimited",
"Minimum sum value of all UTXOs in " + CURRENCY_UNIT +
""},
},
@@ -3665,35 +3626,31 @@
"Only pay-to-pubkey, multisig, and P2SH versions thereof are "
"currently supported for watch-only\n",
{
- {"hexstring", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "", "The hex string of the raw transaction"},
+ {"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO,
+ "The hex string of the raw transaction"},
{"options",
RPCArg::Type::OBJ,
- /* opt */ true,
- /* default_val */ "null",
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"for backward compatibility: passing in a true instead of an "
"object will result in {\"includeWatching\":true}",
{
- {"changeAddress", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "pool address",
+ {"changeAddress", RPCArg::Type::STR,
+ /* default */ "pool address",
"The bitcoin address to receive the change"},
- {"changePosition", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "", "The index of the change output"},
- {"includeWatching", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"changePosition", RPCArg::Type::NUM, /* default */ "",
+ "The index of the change output"},
+ {"includeWatching", RPCArg::Type::BOOL,
+ /* default */ "false",
"Also select inputs which are watch only"},
- {"lockUnspents", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"lockUnspents", RPCArg::Type::BOOL, /* default */ "false",
"Lock selected unspent outputs"},
- {"feeRate", RPCArg::Type::AMOUNT, /* opt */ true,
- /* default_val */
+ {"feeRate", RPCArg::Type::AMOUNT, /* default */
"not set: makes wallet determine the fee",
"Set a specific fee rate in " + CURRENCY_UNIT + "/kB"},
{
"subtractFeeFromOutputs",
RPCArg::Type::ARR,
- /* opt */ true,
- /* default_val */ "empty array",
+ /* default */ "empty array",
"A json array of integers.\n"
" The fee will be "
"equally deducted from the amount of each "
@@ -3705,7 +3662,7 @@
"specified here, the sender pays the fee.",
{
{"vout_index", RPCArg::Type::NUM,
- /* opt */ true, /* default_val */ "",
+ RPCArg::Optional::OMITTED,
"The zero-based output index, before a "
"change output is added."},
},
@@ -3778,42 +3735,36 @@
"chain.\n" +
HelpRequiringPassphrase(pwallet) + "\n",
{
- {"hexstring", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The transaction hex string"},
+ {"hexstring", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The transaction hex string"},
{
"prevtxs",
RPCArg::Type::ARR,
- /* opt */ true,
- /* default_val */ "null",
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"A json array of previous dependent transaction outputs",
{
{
"",
RPCArg::Type::OBJ,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::OMITTED,
"",
{
{"txid", RPCArg::Type::STR_HEX,
- /* opt */ false, /* default_val */ "",
- "The transaction id"},
- {"vout", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "", "The output number"},
+ RPCArg::Optional::NO, "The transaction id"},
+ {"vout", RPCArg::Type::NUM,
+ RPCArg::Optional::NO, "The output number"},
{"scriptPubKey", RPCArg::Type::STR_HEX,
- /* opt */ false, /* default_val */ "",
- "script key"},
+ RPCArg::Optional::NO, "script key"},
{"redeemScript", RPCArg::Type::STR_HEX,
- /* opt */ true, /* default_val */ "omitted",
+ RPCArg::Optional::OMITTED,
"(required for P2SH)"},
{"amount", RPCArg::Type::AMOUNT,
- /* opt */ false, /* default_val */ "",
- "The amount spent"},
+ RPCArg::Optional::NO, "The amount spent"},
},
},
},
},
- {"sighashtype", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "ALL|FORKID",
+ {"sighashtype", RPCArg::Type::STR, /* default */ "ALL|FORKID",
"The signature hash type. Must be one of\n"
" \"ALL|FORKID\"\n"
" \"NONE|FORKID\"\n"
@@ -3883,11 +3834,10 @@
"\nMine up to nblocks blocks immediately (before the RPC call "
"returns) to an address in the wallet.\n",
{
- {"nblocks", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "",
+ {"nblocks", RPCArg::Type::NUM, RPCArg::Optional::NO,
"How many blocks are generated immediately."},
- {"maxtries", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "1000000", "How many iterations to try."},
+ {"maxtries", RPCArg::Type::NUM, /* default */ "1000000",
+ "How many iterations to try."},
},
RPCResult{
"[ blockhashes ] (array) hashes of blocks generated\n"},
@@ -3944,11 +3894,10 @@
"rescanblockchain",
"\nRescan the local blockchain for wallet related transactions.\n",
{
- {"start_height", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "0",
+ {"start_height", RPCArg::Type::NUM, /* default */ "0",
"block height where the rescan should start"},
- {"stop_height", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "tip height",
+ {"stop_height", RPCArg::Type::NUM,
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"the last block height that should be scanned"},
},
RPCResult{"{\n"
@@ -4164,8 +4113,7 @@
"information requires the address\n"
"to be in the wallet.\n",
{
- {"address", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "",
+ {"address", RPCArg::Type::STR, RPCArg::Optional::NO,
"The bitcoin address to get the information of."},
},
RPCResult{
@@ -4330,8 +4278,8 @@
"\nReturns the list of addresses assigned the specified "
"label.\n",
{
- {"label", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The label."},
+ {"label", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The label."},
},
RPCResult{"{ (json object with addresses as keys)\n"
" \"address\": { (json object with information about "
@@ -4392,8 +4340,8 @@
"\nReturns the list of all labels, or labels that are "
"assigned to addresses with a specific purpose.\n",
{
- {"purpose", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "null",
+ {"purpose", RPCArg::Type::STR,
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"Address purpose to list labels for ('send','receive'). An "
"empty string is the same as not providing this argument."},
},
@@ -4456,8 +4404,7 @@
"after setting the HD wallet seed.\n" +
HelpRequiringPassphrase(pwallet) + "\n",
{
- {"newkeypool", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "true",
+ {"newkeypool", RPCArg::Type::BOOL, /* default */ "true",
"Whether to flush old unused addresses, including change "
"addresses, from the keypool and regenerate it.\n"
" If true, the next address from "
@@ -4468,8 +4415,7 @@
"enabled) from the existing\n"
" keypool will be used until it "
"has been depleted."},
- {"seed", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "random seed",
+ {"seed", RPCArg::Type::STR, /* default */ "random seed",
"The WIF private key to use as the new HD seed.\n"
" The seed value can be retrieved "
"using the dumpwallet command. It is the private key marked "
@@ -4558,13 +4504,11 @@
"sign inputs that we can sign for." +
HelpRequiringPassphrase(pwallet) + "\n",
{
- {"psbt", RPCArg::Type::STR, /* opt */ false,
- /* default_val */ "", "The transaction base64 string"},
- {"sign", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "true",
+ {"psbt", RPCArg::Type::STR, RPCArg::Optional::NO,
+ "The transaction base64 string"},
+ {"sign", RPCArg::Type::BOOL, /* default */ "true",
"Also sign the transaction when updating"},
- {"sighashtype", RPCArg::Type::STR, /* opt */ true,
- /* default_val */ "ALL|FORKID",
+ {"sighashtype", RPCArg::Type::STR, /* default */ "ALL|FORKID",
"The signature hash type to sign with if not specified by "
"the PSBT. Must be one of\n"
" \"ALL|FORKID\"\n"
@@ -4573,8 +4517,7 @@
" \"ALL|FORKID|ANYONECANPAY\"\n"
" \"NONE|FORKID|ANYONECANPAY\"\n"
" \"SINGLE|FORKID|ANYONECANPAY\""},
- {"bip32derivs", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"bip32derivs", RPCArg::Type::BOOL, /* default */ "false",
"If true, includes the BIP 32 derivation paths for public "
"keys if we know them"},
},
@@ -4650,25 +4593,21 @@
{
"inputs",
RPCArg::Type::ARR,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"A json array of json objects",
{
{
"",
RPCArg::Type::OBJ,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::OMITTED,
"",
{
{"txid", RPCArg::Type::STR_HEX,
- /* opt */ false, /* default_val */ "",
- "The transaction id"},
- {"vout", RPCArg::Type::NUM, /* opt */ false,
- /* default_val */ "", "The output number"},
+ RPCArg::Optional::NO, "The transaction id"},
+ {"vout", RPCArg::Type::NUM,
+ RPCArg::Optional::NO, "The output number"},
{"sequence", RPCArg::Type::NUM,
- /* opt */ false, /* default_val */ "",
- "The sequence number"},
+ RPCArg::Optional::NO, "The sequence number"},
},
},
},
@@ -4676,8 +4615,7 @@
{
"outputs",
RPCArg::Type::ARR,
- /* opt */ false,
- /* default_val */ "",
+ RPCArg::Optional::NO,
"a json array with outputs (key-value pairs).\n"
"For compatibility reasons, a dictionary, which holds "
"the key-value pairs directly, is also\n"
@@ -4687,12 +4625,11 @@
{
"",
RPCArg::Type::OBJ,
- /* opt */ true,
- /* default_val */ "",
+ RPCArg::Optional::OMITTED,
"",
{
{"address", RPCArg::Type::AMOUNT,
- /* opt */ false, /* default_val */ "",
+ RPCArg::Optional::NO,
"A key-value pair. The key (string) is the "
"bitcoin address, the value (float or string) "
"is the amount in " +
@@ -4702,20 +4639,18 @@
{
"",
RPCArg::Type::OBJ,
- /* opt */ true,
- /* default_val */ "",
+ RPCArg::Optional::OMITTED,
"",
{
- {"data", RPCArg::Type::STR_HEX, /* opt */ false,
- /* default_val */ "",
+ {"data", RPCArg::Type::STR_HEX,
+ RPCArg::Optional::NO,
"A key-value pair. The key must be \"data\", "
"the value is hex-encoded data"},
},
},
},
},
- {"locktime", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "0",
+ {"locktime", RPCArg::Type::NUM, /* default */ "0",
"Raw locktime. Non-0 value also locktime-activates inputs\n"
" Allows this transaction to "
"be replaced by a transaction with higher fees. If provided, "
@@ -4723,31 +4658,26 @@
"incompatible."},
{"options",
RPCArg::Type::OBJ,
- /* opt */ true,
- /* default_val */ "null",
+ RPCArg::Optional::OMITTED_NAMED_ARG,
"",
{
{"changeAddress", RPCArg::Type::STR_HEX,
- /* opt */ true, /* default_val */ "pool address",
+ /* default */ "pool address",
"The bitcoin address to receive the change"},
- {"changePosition", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "random",
- "The index of the change output"},
- {"includeWatching", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"changePosition", RPCArg::Type::NUM,
+ /* default */ "random", "The index of the change output"},
+ {"includeWatching", RPCArg::Type::BOOL,
+ /* default */ "false",
"Also select inputs which are watch only"},
- {"lockUnspents", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"lockUnspents", RPCArg::Type::BOOL, /* default */ "false",
"Lock selected unspent outputs"},
- {"feeRate", RPCArg::Type::AMOUNT, /* opt */ true,
- /* default_val */
+ {"feeRate", RPCArg::Type::AMOUNT, /* default */
"not set: makes wallet determine the fee",
"Set a specific fee rate in " + CURRENCY_UNIT + "/kB"},
{
"subtractFeeFromOutputs",
RPCArg::Type::ARR,
- /* opt */ true,
- /* default_val */ "empty array",
+ /* default */ "empty array",
"A json array of integers.\n"
" The fee will be "
"equally deducted from the amount of each specified "
@@ -4758,16 +4688,15 @@
" If no outputs are "
"specified here, the sender pays the fee.",
{
- {"vout_index", RPCArg::Type::NUM, /* opt */ true,
- /* default_val */ "",
+ {"vout_index", RPCArg::Type::NUM,
+ RPCArg::Optional::OMITTED,
"The zero-based output index, before a change "
"output is added."},
},
},
},
"options"},
- {"bip32derivs", RPCArg::Type::BOOL, /* opt */ true,
- /* default_val */ "false",
+ {"bip32derivs", RPCArg::Type::BOOL, /* default */ "false",
"If true, includes the BIP 32 derivation paths for public "
"keys if we know them"},
},

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 1, 11:04 (11 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187474
Default Alt Text
D6064.diff (122 KB)

Event Timeline