Skip to content

Commit b2df292

Browse files
committed
Merge #8951: RPC/Mining: getblocktemplate: Update and fix formatting of help
59daa58 RPC/Mining: getblocktemplate: Update and fix formatting of help (Luke Dashjr)
2 parents e44753c + 59daa58 commit b2df292

File tree

1 file changed

+36
-30
lines changed

1 file changed

+36
-30
lines changed

src/rpc/mining.cpp

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -319,67 +319,73 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
319319
{
320320
if (fHelp || params.size() > 1)
321321
throw runtime_error(
322-
"getblocktemplate ( \"jsonrequestobject\" )\n"
322+
"getblocktemplate ( TemplateRequest )\n"
323323
"\nIf the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'.\n"
324324
"It returns data needed to construct a block to work on.\n"
325-
"For full specification, see BIPs 22 and 9:\n"
325+
"For full specification, see BIPs 22, 23, 9, and 145:\n"
326326
" https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki\n"
327+
" https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki\n"
327328
" https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes\n"
329+
" https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki\n"
328330

329331
"\nArguments:\n"
330-
"1. \"jsonrequestobject\" (string, optional) A json object in the following spec\n"
332+
"1. TemplateRequest (json object, optional) A json object in the following spec\n"
331333
" {\n"
332-
" \"mode\":\"template\" (string, optional) This must be set to \"template\" or omitted\n"
333-
" \"capabilities\":[ (array, optional) A list of strings\n"
334-
" \"support\" (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid'\n"
334+
" \"mode\":\"template\" (string, optional) This must be set to \"template\", \"proposal\" (see BIP 23), or omitted\n"
335+
" \"capabilities\":[ (array, optional) A list of strings\n"
336+
" \"support\" (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid'\n"
335337
" ,...\n"
336-
" ]\n"
338+
" ],\n"
339+
" \"rules\":[ (array, optional) A list of strings\n"
340+
" \"support\" (string) client side supported softfork deployment\n"
341+
" ,...\n"
342+
" ]\n"
337343
" }\n"
338344
"\n"
339345

340346
"\nResult:\n"
341347
"{\n"
342-
" \"version\" : n, (numeric) The block version\n"
348+
" \"version\" : n, (numeric) The preferred block version\n"
343349
" \"rules\" : [ \"rulename\", ... ], (array of strings) specific block rules that are to be enforced\n"
344350
" \"vbavailable\" : { (json object) set of pending, supported versionbit (BIP 9) softfork deployments\n"
345-
" \"rulename\" : bitnumber (numeric) identifies the bit number as indicating acceptance and readiness for the named softfork rule\n"
351+
" \"rulename\" : bitnumber (numeric) identifies the bit number as indicating acceptance and readiness for the named softfork rule\n"
346352
" ,...\n"
347353
" },\n"
348354
" \"vbrequired\" : n, (numeric) bit mask of versionbits the server requires set in submissions\n"
349-
" \"previousblockhash\" : \"xxxx\", (string) The hash of current highest block\n"
355+
" \"previousblockhash\" : \"xxxx\", (string) The hash of current highest block\n"
350356
" \"transactions\" : [ (array) contents of non-coinbase transactions that should be included in the next block\n"
351357
" {\n"
352-
" \"data\" : \"xxxx\", (string) transaction data encoded in hexadecimal (byte-for-byte)\n"
353-
" \"txid\" : \"xxxx\", (string) transaction id encoded in little-endian hexadecimal\n"
354-
" \"hash\" : \"xxxx\", (string) hash encoded in little-endian hexadecimal (including witness data)\n"
355-
" \"depends\" : [ (array) array of numbers \n"
356-
" n (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is\n"
358+
" \"data\" : \"xxxx\", (string) transaction data encoded in hexadecimal (byte-for-byte)\n"
359+
" \"txid\" : \"xxxx\", (string) transaction id encoded in little-endian hexadecimal\n"
360+
" \"hash\" : \"xxxx\", (string) hash encoded in little-endian hexadecimal (including witness data)\n"
361+
" \"depends\" : [ (array) array of numbers \n"
362+
" n (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is\n"
357363
" ,...\n"
358364
" ],\n"
359-
" \"fee\": n, (numeric) difference in value between transaction inputs and outputs (in Satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one\n"
360-
" \"sigops\" : n, (numeric) total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero\n"
361-
" \"weight\" : n, (numeric) total transaction weight, as counted for purposes of block limits\n"
362-
" \"required\" : true|false (boolean) if provided and true, this transaction must be in the final block\n"
365+
" \"fee\": n, (numeric) difference in value between transaction inputs and outputs (in Satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one\n"
366+
" \"sigops\" : n, (numeric) total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero\n"
367+
" \"weight\" : n, (numeric) total transaction weight, as counted for purposes of block limits\n"
368+
" \"required\" : true|false (boolean) if provided and true, this transaction must be in the final block\n"
363369
" }\n"
364370
" ,...\n"
365371
" ],\n"
366-
" \"coinbaseaux\" : { (json object) data that should be included in the coinbase's scriptSig content\n"
367-
" \"flags\" : \"flags\" (string) \n"
372+
" \"coinbaseaux\" : { (json object) data that should be included in the coinbase's scriptSig content\n"
373+
" \"flags\" : \"xx\" (string) key name is to be ignored, and value included in scriptSig\n"
368374
" },\n"
369-
" \"coinbasevalue\" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in Satoshis)\n"
370-
" \"coinbasetxn\" : { ... }, (json object) information for coinbase transaction\n"
371-
" \"target\" : \"xxxx\", (string) The hash target\n"
372-
" \"mintime\" : xxx, (numeric) The minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT)\n"
373-
" \"mutable\" : [ (array of string) list of ways the block template may be changed \n"
374-
" \"value\" (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'\n"
375+
" \"coinbasevalue\" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in Satoshis)\n"
376+
" \"coinbasetxn\" : { ... }, (json object) information for coinbase transaction\n"
377+
" \"target\" : \"xxxx\", (string) The hash target\n"
378+
" \"mintime\" : xxx, (numeric) The minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT)\n"
379+
" \"mutable\" : [ (array of string) list of ways the block template may be changed \n"
380+
" \"value\" (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'\n"
375381
" ,...\n"
376382
" ],\n"
377-
" \"noncerange\" : \"00000000ffffffff\", (string) A range of valid nonces\n"
378-
" \"sigoplimit\" : n, (numeric) cost limit of sigops in blocks\n"
383+
" \"noncerange\" : \"00000000ffffffff\",(string) A range of valid nonces\n"
384+
" \"sigoplimit\" : n, (numeric) limit of sigops in blocks\n"
379385
" \"sizelimit\" : n, (numeric) limit of block size\n"
380386
" \"weightlimit\" : n, (numeric) limit of block weight\n"
381387
" \"curtime\" : ttt, (numeric) current timestamp in seconds since epoch (Jan 1 1970 GMT)\n"
382-
" \"bits\" : \"xxx\", (string) compressed target of next block\n"
388+
" \"bits\" : \"xxxxxxxx\", (string) compressed target of next block\n"
383389
" \"height\" : n (numeric) The height of the next block\n"
384390
"}\n"
385391

0 commit comments

Comments
 (0)