From 1ed2d2d891a33ab9c2009ad320b7085492c75225 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 23 Feb 2021 18:28:19 +0100 Subject: [PATCH] Merge #21053: rpc, test: document {previous,next}blockhash as optional ba7e17e073f833eccd4c7c111ae9058c3f123371 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 --- test/functional/rpc_blockchain.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py index f1391def37..37df9e687f 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -444,6 +444,9 @@ class BlockchainTest(BitcoinTestFramework): # Restore chain state move_block_file('rev_wrong', 'rev00000.dat') + assert 'previousblockhash' not in node.getblock(node.getblockhash(0)) + assert 'nextblockhash' not in node.getblock(node.getbestblockhash()) + if __name__ == '__main__': BlockchainTest().main()