Skip to content

Commit 22acd36

Browse files
committed
Merge #19646: doc: Updated outdated help command for getblocktemplate
c91b241 Updated outdated help command for getblocktemplate (fixes #19625) (Jake Leventhal) Pull request description: **Summary of Changes** * Removed coinbasetxn from the help outputs * Added the missing name for transactions in the help outputs * Added help outputs for longpollid and default_witness_commitment * Added more clarity to capabilities, rules, and coinbaseaux **Rationale** The outputs from the help command for `getblocktemplate` are outdated and don't reflect the actual results from `getblocktemplate` (see #19625 for more details) Fixes #19625. ACKs for top commit: laanwj: ACK c91b241 fjahr: utACK c91b241 Tree-SHA512: ee443af4bc3b2838dfd92e2705f344256ee785ae720e505fffea9b0ec5b75930e3b1374bae59b36d5da57c85c9aefe4d62504b028b893d6f2914dccf1e34c658
2 parents 1dac4dc + c91b241 commit 22acd36

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
@@ -511,12 +511,13 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
511511
{"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"},
512512
{"capabilities", RPCArg::Type::ARR, /* treat as named arg */ RPCArg::Optional::OMITTED_NAMED_ARG, "A list of strings",
513513
{
514-
{"support", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid'"},
514+
{"str", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "client side supported feature, 'longpoll', 'coinbasevalue', 'proposal', 'serverlist', 'workid'"},
515515
},
516516
},
517517
{"rules", RPCArg::Type::ARR, RPCArg::Optional::NO, "A list of strings",
518518
{
519-
{"support", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "client side supported softfork deployment"},
519+
{"segwit", RPCArg::Type::STR, RPCArg::Optional::NO, "(literal) indicates client side segwit support"},
520+
{"str", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "other client side supported softfork deployment"},
520521
},
521522
},
522523
},
@@ -528,15 +529,15 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
528529
{RPCResult::Type::NUM, "version", "The preferred block version"},
529530
{RPCResult::Type::ARR, "rules", "specific block rules that are to be enforced",
530531
{
531-
{RPCResult::Type::STR, "", "rulename"},
532+
{RPCResult::Type::STR, "", "name of a rule the client must understand to some extent; see BIP 9 for format"},
532533
}},
533534
{RPCResult::Type::OBJ_DYN, "vbavailable", "set of pending, supported versionbit (BIP 9) softfork deployments",
534535
{
535536
{RPCResult::Type::NUM, "rulename", "identifies the bit number as indicating acceptance and readiness for the named softfork rule"},
536537
}},
537538
{RPCResult::Type::NUM, "vbrequired", "bit mask of versionbits the server requires set in submissions"},
538539
{RPCResult::Type::STR, "previousblockhash", "The hash of current highest block"},
539-
{RPCResult::Type::ARR, "", "contents of non-coinbase transactions that should be included in the next block",
540+
{RPCResult::Type::ARR, "transactions", "contents of non-coinbase transactions that should be included in the next block",
540541
{
541542
{RPCResult::Type::OBJ, "", "",
542543
{
@@ -552,15 +553,12 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
552553
{RPCResult::Type::NUM, "weight", "total transaction weight, as counted for purposes of block limits"},
553554
}},
554555
}},
555-
{RPCResult::Type::OBJ, "coinbaseaux", "data that should be included in the coinbase's scriptSig content",
556+
{RPCResult::Type::OBJ_DYN, "coinbaseaux", "data that should be included in the coinbase's scriptSig content",
556557
{
557-
{RPCResult::Type::ELISION, "", ""},
558+
{RPCResult::Type::STR_HEX, "key", "values must be in the coinbase (keys may be ignored)"},
558559
}},
559560
{RPCResult::Type::NUM, "coinbasevalue", "maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)"},
560-
{RPCResult::Type::OBJ, "coinbasetxn", "information for coinbase transaction",
561-
{
562-
{RPCResult::Type::ELISION, "", ""},
563-
}},
561+
{RPCResult::Type::STR, "longpollid", "an id to include with a request to longpoll on an update to this template"},
564562
{RPCResult::Type::STR, "target", "The hash target"},
565563
{RPCResult::Type::NUM_TIME, "mintime", "The minimum timestamp appropriate for the next block time, expressed in " + UNIX_EPOCH_TIME},
566564
{RPCResult::Type::ARR, "mutable", "list of ways the block template may be changed",
@@ -574,6 +572,7 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
574572
{RPCResult::Type::NUM_TIME, "curtime", "current timestamp in " + UNIX_EPOCH_TIME},
575573
{RPCResult::Type::STR, "bits", "compressed target of next block"},
576574
{RPCResult::Type::NUM, "height", "The height of the next block"},
575+
{RPCResult::Type::STR, "default_witness_commitment", /* optional */ true, "a valid witness commitment for the unmodified block template"}
577576
}},
578577
RPCExamples{
579578
HelpExampleCli("getblocktemplate", "'{\"rules\": [\"segwit\"]}'")

0 commit comments

Comments
 (0)