mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-12 00:27:53 +02:00
rpc, test: document {previous,next}blockhash as optional
Affects the following RPCs: - getblockheader - getblock Also adds trivial tests on genesis block (should not contain "previousblockhash") and best block (should not contain "nextblockhash").
This commit is contained in:
@@ -821,8 +821,8 @@ static RPCHelpMan getblockheader()
|
||||
{RPCResult::Type::NUM, "difficulty", "The difficulty"},
|
||||
{RPCResult::Type::STR_HEX, "chainwork", "Expected number of hashes required to produce the current chain"},
|
||||
{RPCResult::Type::NUM, "nTx", "The number of transactions in the block"},
|
||||
{RPCResult::Type::STR_HEX, "previousblockhash", "The hash of the previous block"},
|
||||
{RPCResult::Type::STR_HEX, "nextblockhash", "The hash of the next block"},
|
||||
{RPCResult::Type::STR_HEX, "previousblockhash", /* optional */ true, "The hash of the previous block (if available)"},
|
||||
{RPCResult::Type::STR_HEX, "nextblockhash", /* optional */ true, "The hash of the next block (if available)"},
|
||||
}},
|
||||
RPCResult{"for verbose=false",
|
||||
RPCResult::Type::STR_HEX, "", "A string that is serialized, hex-encoded data for block 'hash'"},
|
||||
@@ -929,8 +929,8 @@ static RPCHelpMan getblock()
|
||||
{RPCResult::Type::NUM, "difficulty", "The difficulty"},
|
||||
{RPCResult::Type::STR_HEX, "chainwork", "Expected number of hashes required to produce the chain up to this block (in hex)"},
|
||||
{RPCResult::Type::NUM, "nTx", "The number of transactions in the block"},
|
||||
{RPCResult::Type::STR_HEX, "previousblockhash", "The hash of the previous block"},
|
||||
{RPCResult::Type::STR_HEX, "nextblockhash", "The hash of the next block"},
|
||||
{RPCResult::Type::STR_HEX, "previousblockhash", /* optional */ true, "The hash of the previous block (if available)"},
|
||||
{RPCResult::Type::STR_HEX, "nextblockhash", /* optional */ true, "The hash of the next block (if available)"},
|
||||
}},
|
||||
RPCResult{"for verbosity = 2",
|
||||
RPCResult::Type::OBJ, "", "",
|
||||
|
||||
Reference in New Issue
Block a user