Skip to content

Commit c91b241

Browse files
jakeleventhalLuke Dashjr
andcommitted
Updated outdated help command for getblocktemplate (fixes #19625)
* Removed coinbasetxn from the getblocktemplate help outputs * Added the missing name for transactions in the help outputs * Added getblocktemplate help outputs for longpollid and default_witness_commitment * Added more clarity to capabilities, rules, and coinbaseaux for getblocktemplate help (credit to luke-jr) Co-authored-by: Luke Dashjr <[email protected]>
1 parent a787428 commit c91b241

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/rpc/mining.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -500,12 +500,13 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
500500
{"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"},
501501
{"capabilities", RPCArg::Type::ARR, /* treat as named arg */ RPCArg::Optional::OMITTED_NAMED_ARG, "A list of strings",
502502
{
503-
{"support", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid'"},
503+
{"str", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "client side supported feature, 'longpoll', 'coinbasevalue', 'proposal', 'serverlist', 'workid'"},
504504
},
505505
},
506506
{"rules", RPCArg::Type::ARR, RPCArg::Optional::NO, "A list of strings",
507507
{
508-
{"support", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "client side supported softfork deployment"},
508+
{"segwit", RPCArg::Type::STR, RPCArg::Optional::NO, "(literal) indicates client side segwit support"},
509+
{"str", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "other client side supported softfork deployment"},
509510
},
510511
},
511512
},
@@ -517,15 +518,15 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
517518
{RPCResult::Type::NUM, "version", "The preferred block version"},
518519
{RPCResult::Type::ARR, "rules", "specific block rules that are to be enforced",
519520
{
520-
{RPCResult::Type::STR, "", "rulename"},
521+
{RPCResult::Type::STR, "", "name of a rule the client must understand to some extent; see BIP 9 for format"},
521522
}},
522523
{RPCResult::Type::OBJ_DYN, "vbavailable", "set of pending, supported versionbit (BIP 9) softfork deployments",
523524
{
524525
{RPCResult::Type::NUM, "rulename", "identifies the bit number as indicating acceptance and readiness for the named softfork rule"},
525526
}},
526527
{RPCResult::Type::NUM, "vbrequired", "bit mask of versionbits the server requires set in submissions"},
527528
{RPCResult::Type::STR, "previousblockhash", "The hash of current highest block"},
528-
{RPCResult::Type::ARR, "", "contents of non-coinbase transactions that should be included in the next block",
529+
{RPCResult::Type::ARR, "transactions", "contents of non-coinbase transactions that should be included in the next block",
529530
{
530531
{RPCResult::Type::OBJ, "", "",
531532
{
@@ -541,15 +542,12 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
541542
{RPCResult::Type::NUM, "weight", "total transaction weight, as counted for purposes of block limits"},
542543
}},
543544
}},
544-
{RPCResult::Type::OBJ, "coinbaseaux", "data that should be included in the coinbase's scriptSig content",
545+
{RPCResult::Type::OBJ_DYN, "coinbaseaux", "data that should be included in the coinbase's scriptSig content",
545546
{
546-
{RPCResult::Type::ELISION, "", ""},
547+
{RPCResult::Type::STR_HEX, "key", "values must be in the coinbase (keys may be ignored)"},
547548
}},
548549
{RPCResult::Type::NUM, "coinbasevalue", "maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)"},
549-
{RPCResult::Type::OBJ, "coinbasetxn", "information for coinbase transaction",
550-
{
551-
{RPCResult::Type::ELISION, "", ""},
552-
}},
550+
{RPCResult::Type::STR, "longpollid", "an id to include with a request to longpoll on an update to this template"},
553551
{RPCResult::Type::STR, "target", "The hash target"},
554552
{RPCResult::Type::NUM_TIME, "mintime", "The minimum timestamp appropriate for the next block time, expressed in " + UNIX_EPOCH_TIME},
555553
{RPCResult::Type::ARR, "mutable", "list of ways the block template may be changed",
@@ -563,6 +561,7 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
563561
{RPCResult::Type::NUM_TIME, "curtime", "current timestamp in " + UNIX_EPOCH_TIME},
564562
{RPCResult::Type::STR, "bits", "compressed target of next block"},
565563
{RPCResult::Type::NUM, "height", "The height of the next block"},
564+
{RPCResult::Type::STR, "default_witness_commitment", /* optional */ true, "a valid witness commitment for the unmodified block template"}
566565
}},
567566
RPCExamples{
568567
HelpExampleCli("getblocktemplate", "'{\"rules\": [\"segwit\"]}'")

0 commit comments

Comments
 (0)