From cc6f55191a75dafa669fc6ee93ed86d860eb0d4a Mon Sep 17 00:00:00 2001 From: Dagur Valberg Johannsson Date: Sun, 9 Oct 2016 15:47:55 -0400 Subject: [PATCH] [qa] Fix compact block shortids for a test case Github-Pull: #8904 Rebased-From: 4cdece40419bcc97345357f9268e03b0aff400b5 --- qa/rpc-tests/p2p-compactblocks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qa/rpc-tests/p2p-compactblocks.py b/qa/rpc-tests/p2p-compactblocks.py index cdcfb36e7..e7f5a1c9c 100755 --- a/qa/rpc-tests/p2p-compactblocks.py +++ b/qa/rpc-tests/p2p-compactblocks.py @@ -402,7 +402,9 @@ class CompactBlocksTest(BitcoinTestFramework): comp_block = HeaderAndShortIDs() comp_block.header = CBlockHeader(block) comp_block.nonce = 0 - comp_block.shortids = [1] # this is useless, and wrong + [k0, k1] = comp_block.get_siphash_keys() + comp_block.shortids = [ + calculate_shortid(k0, k1, block.vtx[0].sha256) ] test_node.send_and_ping(msg_cmpctblock(comp_block.to_p2p())) assert_equal(int(node.getbestblockhash(), 16), block.hashPrevBlock) # Expect a getblocktxn message.