Skip to content

Commit b81e507

Browse files
committed
Merge bitcoin/bitcoin#32514: scripted-diff: Remove unused leading newline in RPC docs
fa1f10a doc: Fix minor typos in rpc help (MarcoFalke) fae840e rpc: Reject beginning newline in RPC docs (MarcoFalke) fa414ed scripted-diff: Remove unused leading newline in RPC docs (MarcoFalke) Pull request description: It is harmless, but newlines in the beginning read a bit odd ("nReturns"). So just require them to not be present. The diff is large, but a trivial scripted-diff. ACKs for top commit: fanquake: ACK fa1f10a w0xlt: ACK bitcoin/bitcoin@fa1f10a Tree-SHA512: 5d2f9632f42ec1c02814d050f223941f436e5b0df426d7d6eb93fdd0ff118d57185af07b271dd73af63735dd17231125826c0c9ce0aad36bc8829c5b050a628c
2 parents 3023d7e + fa1f10a commit b81e507

21 files changed

+353
-240
lines changed

src/rpc/blockchain.cpp

Lines changed: 67 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,9 @@ UniValue blockToJSON(BlockManager& blockman, const CBlock& block, const CBlockIn
219219

220220
static RPCHelpMan getblockcount()
221221
{
222-
return RPCHelpMan{"getblockcount",
223-
"\nReturns the height of the most-work fully-validated chain.\n"
222+
return RPCHelpMan{
223+
"getblockcount",
224+
"Returns the height of the most-work fully-validated chain.\n"
224225
"The genesis block has height 0.\n",
225226
{},
226227
RPCResult{
@@ -240,8 +241,9 @@ static RPCHelpMan getblockcount()
240241

241242
static RPCHelpMan getbestblockhash()
242243
{
243-
return RPCHelpMan{"getbestblockhash",
244-
"\nReturns the hash of the best (tip) block in the most-work fully-validated chain.\n",
244+
return RPCHelpMan{
245+
"getbestblockhash",
246+
"Returns the hash of the best (tip) block in the most-work fully-validated chain.\n",
245247
{},
246248
RPCResult{
247249
RPCResult::Type::STR_HEX, "", "the block hash, hex-encoded"},
@@ -260,8 +262,9 @@ static RPCHelpMan getbestblockhash()
260262

261263
static RPCHelpMan waitfornewblock()
262264
{
263-
return RPCHelpMan{"waitfornewblock",
264-
"\nWaits for any new block and returns useful info about it.\n"
265+
return RPCHelpMan{
266+
"waitfornewblock",
267+
"Waits for any new block and returns useful info about it.\n"
265268
"\nReturns the current block on timeout or exit.\n"
266269
"\nMake sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)",
267270
{
@@ -305,8 +308,9 @@ static RPCHelpMan waitfornewblock()
305308

306309
static RPCHelpMan waitforblock()
307310
{
308-
return RPCHelpMan{"waitforblock",
309-
"\nWaits for a specific new block and returns useful info about it.\n"
311+
return RPCHelpMan{
312+
"waitforblock",
313+
"Waits for a specific new block and returns useful info about it.\n"
310314
"\nReturns the current block on timeout or exit.\n"
311315
"\nMake sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)",
312316
{
@@ -365,8 +369,9 @@ static RPCHelpMan waitforblock()
365369

366370
static RPCHelpMan waitforblockheight()
367371
{
368-
return RPCHelpMan{"waitforblockheight",
369-
"\nWaits for (at least) block height and returns the height and hash\n"
372+
return RPCHelpMan{
373+
"waitforblockheight",
374+
"Waits for (at least) block height and returns the height and hash\n"
370375
"of the current tip.\n"
371376
"\nReturns the current block on timeout or exit.\n"
372377
"\nMake sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)",
@@ -427,8 +432,9 @@ static RPCHelpMan waitforblockheight()
427432

428433
static RPCHelpMan syncwithvalidationinterfacequeue()
429434
{
430-
return RPCHelpMan{"syncwithvalidationinterfacequeue",
431-
"\nWaits for the validation interface queue to catch up on everything that was there when we entered this function.\n",
435+
return RPCHelpMan{
436+
"syncwithvalidationinterfacequeue",
437+
"Waits for the validation interface queue to catch up on everything that was there when we entered this function.\n",
432438
{},
433439
RPCResult{RPCResult::Type::NONE, "", ""},
434440
RPCExamples{
@@ -446,8 +452,9 @@ static RPCHelpMan syncwithvalidationinterfacequeue()
446452

447453
static RPCHelpMan getdifficulty()
448454
{
449-
return RPCHelpMan{"getdifficulty",
450-
"\nReturns the proof-of-work difficulty as a multiple of the minimum difficulty.\n",
455+
return RPCHelpMan{
456+
"getdifficulty",
457+
"Returns the proof-of-work difficulty as a multiple of the minimum difficulty.\n",
451458
{},
452459
RPCResult{
453460
RPCResult::Type::NUM, "", "the proof-of-work difficulty as a multiple of the minimum difficulty."},
@@ -521,8 +528,9 @@ static RPCHelpMan getblockfrompeer()
521528

522529
static RPCHelpMan getblockhash()
523530
{
524-
return RPCHelpMan{"getblockhash",
525-
"\nReturns hash of block in best-block-chain at height provided.\n",
531+
return RPCHelpMan{
532+
"getblockhash",
533+
"Returns hash of block in best-block-chain at height provided.\n",
526534
{
527535
{"height", RPCArg::Type::NUM, RPCArg::Optional::NO, "The height index"},
528536
},
@@ -550,8 +558,9 @@ static RPCHelpMan getblockhash()
550558

551559
static RPCHelpMan getblockheader()
552560
{
553-
return RPCHelpMan{"getblockheader",
554-
"\nIf verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'.\n"
561+
return RPCHelpMan{
562+
"getblockheader",
563+
"If verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'.\n"
555564
"If verbose is true, returns an Object with information about blockheader <hash>.\n",
556565
{
557566
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The block hash"},
@@ -715,8 +724,9 @@ const RPCResult getblock_vin{
715724

716725
static RPCHelpMan getblock()
717726
{
718-
return RPCHelpMan{"getblock",
719-
"\nIf verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.\n"
727+
return RPCHelpMan{
728+
"getblock",
729+
"If verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.\n"
720730
"If verbosity is 1, returns an Object with information about block <hash>.\n"
721731
"If verbosity is 2, returns an Object with information about block <hash> and information about each transaction.\n"
722732
"If verbosity is 3, returns an Object with information about block <hash> and information about each transaction, including prevout information for inputs (only for unpruned blocks in the current best chain).\n",
@@ -954,8 +964,9 @@ static std::optional<kernel::CCoinsStats> GetUTXOStats(CCoinsView* view, node::B
954964

955965
static RPCHelpMan gettxoutsetinfo()
956966
{
957-
return RPCHelpMan{"gettxoutsetinfo",
958-
"\nReturns statistics about the unspent transaction output set.\n"
967+
return RPCHelpMan{
968+
"gettxoutsetinfo",
969+
"Returns statistics about the unspent transaction output set.\n"
959970
"Note this call may take some time if you are not using coinstatsindex.\n",
960971
{
961972
{"hash_type", RPCArg::Type::STR, RPCArg::Default{"hash_serialized_3"}, "Which UTXO set hash should be calculated. Options: 'hash_serialized_3' (the legacy algorithm), 'muhash', 'none'."},
@@ -1109,8 +1120,9 @@ static RPCHelpMan gettxoutsetinfo()
11091120

11101121
static RPCHelpMan gettxout()
11111122
{
1112-
return RPCHelpMan{"gettxout",
1113-
"\nReturns details about an unspent transaction output.\n",
1123+
return RPCHelpMan{
1124+
"gettxout",
1125+
"Returns details about an unspent transaction output.\n",
11141126
{
11151127
{"txid", RPCArg::Type::STR, RPCArg::Optional::NO, "The transaction id"},
11161128
{"n", RPCArg::Type::NUM, RPCArg::Optional::NO, "vout number"},
@@ -1188,8 +1200,9 @@ static RPCHelpMan gettxout()
11881200

11891201
static RPCHelpMan verifychain()
11901202
{
1191-
return RPCHelpMan{"verifychain",
1192-
"\nVerifies blockchain database.\n",
1203+
return RPCHelpMan{
1204+
"verifychain",
1205+
"Verifies blockchain database.\n",
11931206
{
11941207
{"checklevel", RPCArg::Type::NUM, RPCArg::DefaultHint{strprintf("%d, range=0-4", DEFAULT_CHECKLEVEL)},
11951208
strprintf("How thorough the block verification is:\n%s", MakeUnorderedList(CHECKLEVEL_DOC))},
@@ -1570,8 +1583,9 @@ static RPCHelpMan getchaintips()
15701583

15711584
static RPCHelpMan preciousblock()
15721585
{
1573-
return RPCHelpMan{"preciousblock",
1574-
"\nTreats a block as if it were received before others with the same work.\n"
1586+
return RPCHelpMan{
1587+
"preciousblock",
1588+
"Treats a block as if it were received before others with the same work.\n"
15751589
"\nA later preciousblock call can override the effect of an earlier one.\n"
15761590
"\nThe effects of preciousblock are not retained across restarts.\n",
15771591
{
@@ -1631,8 +1645,9 @@ void InvalidateBlock(ChainstateManager& chainman, const uint256 block_hash) {
16311645

16321646
static RPCHelpMan invalidateblock()
16331647
{
1634-
return RPCHelpMan{"invalidateblock",
1635-
"\nPermanently marks a block as invalid, as if it violated a consensus rule.\n",
1648+
return RPCHelpMan{
1649+
"invalidateblock",
1650+
"Permanently marks a block as invalid, as if it violated a consensus rule.\n",
16361651
{
16371652
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "the hash of the block to mark as invalid"},
16381653
},
@@ -1675,8 +1690,9 @@ void ReconsiderBlock(ChainstateManager& chainman, uint256 block_hash) {
16751690

16761691
static RPCHelpMan reconsiderblock()
16771692
{
1678-
return RPCHelpMan{"reconsiderblock",
1679-
"\nRemoves invalidity status of a block, its ancestors and its descendants, reconsider them for activation.\n"
1693+
return RPCHelpMan{
1694+
"reconsiderblock",
1695+
"Removes invalidity status of a block, its ancestors and its descendants, reconsider them for activation.\n"
16801696
"This can be used to undo the effects of invalidateblock.\n",
16811697
{
16821698
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "the hash of the block to reconsider"},
@@ -1700,8 +1716,9 @@ static RPCHelpMan reconsiderblock()
17001716

17011717
static RPCHelpMan getchaintxstats()
17021718
{
1703-
return RPCHelpMan{"getchaintxstats",
1704-
"\nCompute statistics about the total number and rate of transactions in the chain.\n",
1719+
return RPCHelpMan{
1720+
"getchaintxstats",
1721+
"Compute statistics about the total number and rate of transactions in the chain.\n",
17051722
{
17061723
{"nblocks", RPCArg::Type::NUM, RPCArg::DefaultHint{"one month"}, "Size of the window in number of blocks"},
17071724
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::DefaultHint{"chain tip"}, "The hash of the block that ends the window."},
@@ -1846,8 +1863,9 @@ static constexpr size_t PER_UTXO_OVERHEAD = sizeof(COutPoint) + sizeof(uint32_t)
18461863

18471864
static RPCHelpMan getblockstats()
18481865
{
1849-
return RPCHelpMan{"getblockstats",
1850-
"\nCompute per block statistics for a given window. All amounts are in satoshis.\n"
1866+
return RPCHelpMan{
1867+
"getblockstats",
1868+
"Compute per block statistics for a given window. All amounts are in satoshis.\n"
18511869
"It won't work for some heights with pruning.\n",
18521870
{
18531871
{"hash_or_height", RPCArg::Type::NUM, RPCArg::Optional::NO, "The block hash or height of the target block",
@@ -2204,8 +2222,9 @@ static RPCHelpMan scantxoutset()
22042222
// raw() descriptor corresponding to mainnet address 12cbQLTFMXRnSzktFkuoG3eHoMeFtpTu3S
22052223
const std::string EXAMPLE_DESCRIPTOR_RAW = "raw(76a91411b366edfc0a8b66feebae5c2e25a7b6a5d1cf3188ac)#fm24fxxy";
22062224

2207-
return RPCHelpMan{"scantxoutset",
2208-
"\nScans the unspent transaction output set for entries that match certain output descriptors.\n"
2225+
return RPCHelpMan{
2226+
"scantxoutset",
2227+
"Scans the unspent transaction output set for entries that match certain output descriptors.\n"
22092228
"Examples of output descriptors are:\n"
22102229
" addr(<address>) Outputs whose output script corresponds to the specified address (does not include P2PK)\n"
22112230
" raw(<hex script>) Outputs whose output script equals the specified hex-encoded bytes\n"
@@ -2415,8 +2434,9 @@ static bool CheckBlockFilterMatches(BlockManager& blockman, const CBlockIndex& b
24152434

24162435
static RPCHelpMan scanblocks()
24172436
{
2418-
return RPCHelpMan{"scanblocks",
2419-
"\nReturn relevant blockhashes for given descriptors (requires blockfilterindex).\n"
2437+
return RPCHelpMan{
2438+
"scanblocks",
2439+
"Return relevant blockhashes for given descriptors (requires blockfilterindex).\n"
24202440
"This call may take several minutes. Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)",
24212441
{
24222442
scan_action_arg_desc,
@@ -2603,8 +2623,9 @@ static RPCHelpMan scanblocks()
26032623

26042624
static RPCHelpMan getdescriptoractivity()
26052625
{
2606-
return RPCHelpMan{"getdescriptoractivity",
2607-
"\nGet spend and receive activity associated with a set of descriptors for a set of blocks. "
2626+
return RPCHelpMan{
2627+
"getdescriptoractivity",
2628+
"Get spend and receive activity associated with a set of descriptors for a set of blocks. "
26082629
"This command pairs well with the `relevant_blocks` output of `scanblocks()`.\n"
26092630
"This call may take several minutes. If you encounter timeouts, try specifying no RPC timeout (bitcoin-cli -rpcclienttimeout=0)",
26102631
{
@@ -2832,8 +2853,9 @@ static RPCHelpMan getdescriptoractivity()
28322853

28332854
static RPCHelpMan getblockfilter()
28342855
{
2835-
return RPCHelpMan{"getblockfilter",
2836-
"\nRetrieve a BIP 157 content filter for a particular block.\n",
2856+
return RPCHelpMan{
2857+
"getblockfilter",
2858+
"Retrieve a BIP 157 content filter for a particular block.\n",
28372859
{
28382860
{"blockhash", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hash of the block"},
28392861
{"filtertype", RPCArg::Type::STR, RPCArg::Default{BlockFilterTypeName(BlockFilterType::BASIC)}, "The type name of the filter"},
@@ -3322,7 +3344,7 @@ static RPCHelpMan getchainstates()
33223344
{
33233345
return RPCHelpMan{
33243346
"getchainstates",
3325-
"\nReturn information about chainstates.\n",
3347+
"Return information about chainstates.\n",
33263348
{},
33273349
RPCResult{
33283350
RPCResult::Type::OBJ, "", "", {

src/rpc/fees.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ using node::NodeContext;
2929

3030
static RPCHelpMan estimatesmartfee()
3131
{
32-
return RPCHelpMan{"estimatesmartfee",
33-
"\nEstimates the approximate fee per kilobyte needed for a transaction to begin\n"
32+
return RPCHelpMan{
33+
"estimatesmartfee",
34+
"Estimates the approximate fee per kilobyte needed for a transaction to begin\n"
3435
"confirmation within conf_target blocks if possible and return the number of blocks\n"
3536
"for which the estimate is valid. Uses virtual transaction size as defined\n"
3637
"in BIP 141 (witness data is discounted).\n",
@@ -96,8 +97,9 @@ static RPCHelpMan estimatesmartfee()
9697

9798
static RPCHelpMan estimaterawfee()
9899
{
99-
return RPCHelpMan{"estimaterawfee",
100-
"\nWARNING: This interface is unstable and may disappear or change!\n"
100+
return RPCHelpMan{
101+
"estimaterawfee",
102+
"WARNING: This interface is unstable and may disappear or change!\n"
101103
"\nWARNING: This is an advanced API call that is tightly coupled to the specific\n"
102104
"implementation of fee estimation. The parameters it can be called with\n"
103105
"and the results it returns will change if the internal implementation changes.\n"

src/rpc/mempool.cpp

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ using util::ToString;
4141

4242
static RPCHelpMan sendrawtransaction()
4343
{
44-
return RPCHelpMan{"sendrawtransaction",
45-
"\nSubmit a raw transaction (serialized, hex-encoded) to local node and network.\n"
44+
return RPCHelpMan{
45+
"sendrawtransaction",
46+
"Submit a raw transaction (serialized, hex-encoded) to local node and network.\n"
4647
"\nThe transaction will be sent unconditionally to all peers, so using sendrawtransaction\n"
4748
"for manual rebroadcast may degrade privacy by leaking the transaction's origin, as\n"
4849
"nodes will normally not rebroadcast non-wallet transactions already in their mempool.\n"
@@ -108,8 +109,9 @@ static RPCHelpMan sendrawtransaction()
108109

109110
static RPCHelpMan testmempoolaccept()
110111
{
111-
return RPCHelpMan{"testmempoolaccept",
112-
"\nReturns result of mempool acceptance tests indicating if raw transaction(s) (serialized, hex-encoded) would be accepted by mempool.\n"
112+
return RPCHelpMan{
113+
"testmempoolaccept",
114+
"Returns result of mempool acceptance tests indicating if raw transaction(s) (serialized, hex-encoded) would be accepted by mempool.\n"
113115
"\nIf multiple transactions are passed in, parents must come before children and package policies apply: the transactions cannot conflict with any mempool transactions or each other.\n"
114116
"\nIf one transaction fails, other transactions may not be fully validated (the 'allowed' key will be blank).\n"
115117
"\nThe maximum number of transactions allowed is " + ToString(MAX_PACKAGE_COUNT) + ".\n"
@@ -381,8 +383,9 @@ UniValue MempoolToJSON(const CTxMemPool& pool, bool verbose, bool include_mempoo
381383

382384
static RPCHelpMan getrawmempool()
383385
{
384-
return RPCHelpMan{"getrawmempool",
385-
"\nReturns all transaction ids in memory pool as a json array of string transaction ids.\n"
386+
return RPCHelpMan{
387+
"getrawmempool",
388+
"Returns all transaction ids in memory pool as a json array of string transaction ids.\n"
386389
"\nHint: use getmempoolentry to fetch a specific transaction from the mempool.\n",
387390
{
388391
{"verbose", RPCArg::Type::BOOL, RPCArg::Default{false}, "True for a json object, false for array of transaction ids"},
@@ -431,8 +434,9 @@ static RPCHelpMan getrawmempool()
431434

432435
static RPCHelpMan getmempoolancestors()
433436
{
434-
return RPCHelpMan{"getmempoolancestors",
435-
"\nIf txid is in the mempool, returns all in-mempool ancestors.\n",
437+
return RPCHelpMan{
438+
"getmempoolancestors",
439+
"If txid is in the mempool, returns all in-mempool ancestors.\n",
436440
{
437441
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id (must be in mempool)"},
438442
{"verbose", RPCArg::Type::BOOL, RPCArg::Default{false}, "True for a json object, false for array of transaction ids"},
@@ -492,8 +496,9 @@ static RPCHelpMan getmempoolancestors()
492496

493497
static RPCHelpMan getmempooldescendants()
494498
{
495-
return RPCHelpMan{"getmempooldescendants",
496-
"\nIf txid is in the mempool, returns all in-mempool descendants.\n",
499+
return RPCHelpMan{
500+
"getmempooldescendants",
501+
"If txid is in the mempool, returns all in-mempool descendants.\n",
497502
{
498503
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id (must be in mempool)"},
499504
{"verbose", RPCArg::Type::BOOL, RPCArg::Default{false}, "True for a json object, false for array of transaction ids"},
@@ -557,8 +562,9 @@ static RPCHelpMan getmempooldescendants()
557562

558563
static RPCHelpMan getmempoolentry()
559564
{
560-
return RPCHelpMan{"getmempoolentry",
561-
"\nReturns mempool data for given transaction\n",
565+
return RPCHelpMan{
566+
"getmempoolentry",
567+
"Returns mempool data for given transaction\n",
562568
{
563569
{"txid", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The transaction id (must be in mempool)"},
564570
},
@@ -782,8 +788,9 @@ static RPCHelpMan importmempool()
782788

783789
static RPCHelpMan savemempool()
784790
{
785-
return RPCHelpMan{"savemempool",
786-
"\nDumps the mempool to disk. It will fail until the previous dump is fully loaded.\n",
791+
return RPCHelpMan{
792+
"savemempool",
793+
"Dumps the mempool to disk. It will fail until the previous dump is fully loaded.\n",
787794
{},
788795
RPCResult{
789796
RPCResult::Type::OBJ, "", "",
@@ -854,8 +861,9 @@ static UniValue OrphanToJSON(const TxOrphanage::OrphanTxBase& orphan)
854861

855862
static RPCHelpMan getorphantxs()
856863
{
857-
return RPCHelpMan{"getorphantxs",
858-
"\nShows transactions in the tx orphanage.\n"
864+
return RPCHelpMan{
865+
"getorphantxs",
866+
"Shows transactions in the tx orphanage.\n"
859867
"\nEXPERIMENTAL warning: this call may be changed in future releases.\n",
860868
{
861869
{"verbosity", RPCArg::Type::NUM, RPCArg::Default{0}, "0 for an array of txids (may contain duplicates), 1 for an array of objects with tx details, and 2 for details from (1) and tx hex",

0 commit comments

Comments
 (0)