Skip to content

Commit 1ed2d2d

Browse files
MarcoFalkeknst
authored andcommitted
Merge bitcoin#21053: rpc, test: document {previous,next}blockhash as optional
ba7e17e rpc, test: document {previous,next}blockhash as optional (Sebastian Falbesoner) Pull request description: This PR updates the result help of the following RPCs w.r.t. the `previousblockhash` and `nextblockhash` fields: - getblockheader - getblock Also adds trivial tests on genesis block (should not contain "previousblockhash") and best block (should not contain "nextblockhash"). Top commit has no ACKs. Tree-SHA512: ef42c5c773fc436e1b4a67be14e2532e800e1e30e45e54a57431c6abb714d2c069c70d40ea4012d549293b823a1973b3f569484b3273679683b28ed40abf46bb
1 parent 3b0323a commit 1ed2d2d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/functional/rpc_blockchain.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,9 @@ def move_block_file(old, new):
444444
# Restore chain state
445445
move_block_file('rev_wrong', 'rev00000.dat')
446446

447+
assert 'previousblockhash' not in node.getblock(node.getblockhash(0))
448+
assert 'nextblockhash' not in node.getblock(node.getbestblockhash())
449+
447450

448451
if __name__ == '__main__':
449452
BlockchainTest().main()

0 commit comments

Comments
 (0)