@@ -80,13 +80,11 @@ def on_sendcmpct(self, message):
8080
8181 def on_cmpctblock (self , message ):
8282 self .block_announced = True
83- self .last_message ["cmpctblock" ].header_and_shortids .header .calc_sha256 ()
8483 self .announced_blockhashes .add (self .last_message ["cmpctblock" ].header_and_shortids .header .sha256 )
8584
8685 def on_headers (self , message ):
8786 self .block_announced = True
8887 for x in self .last_message ["headers" ].headers :
89- x .calc_sha256 ()
9088 self .announced_blockhashes .add (x .sha256 )
9189
9290 def on_inv (self , message ):
@@ -308,7 +306,6 @@ def test_compactblock_construction(self, test_node):
308306
309307 # Store the raw block in our internal format.
310308 block = from_hex (CBlock (), node .getblock ("%064x" % block_hash , False ))
311- block .rehash ()
312309
313310 # Wait until the block was announced (via compact blocks)
314311 test_node .wait_until (lambda : "cmpctblock" in test_node .last_message , timeout = 30 )
@@ -336,7 +333,6 @@ def test_compactblock_construction(self, test_node):
336333
337334 def check_compactblock_construction_from_block (self , header_and_shortids , block_hash , block ):
338335 # Check that we got the right block!
339- header_and_shortids .header .calc_sha256 ()
340336 assert_equal (header_and_shortids .header .sha256 , block_hash )
341337
342338 # Make sure the prefilled_txn appears to have included the coinbase
@@ -599,7 +595,6 @@ def test_getblocktxn_handler(self, test_node):
599595 test_node .last_message .pop ("blocktxn" , None )
600596 test_node .send_and_ping (msg )
601597 with p2p_lock :
602- test_node .last_message ["block" ].block .calc_sha256 ()
603598 assert_equal (test_node .last_message ["block" ].block .sha256 , int (block_hash , 16 ))
604599 assert "blocktxn" not in test_node .last_message
605600
@@ -656,7 +651,6 @@ def test_compactblocks_not_at_tip(self, test_node):
656651 test_node .send_without_ping (msg_getdata ([CInv (MSG_CMPCT_BLOCK , int (new_blocks [0 ], 16 ))]))
657652 test_node .wait_until (lambda : "block" in test_node .last_message , timeout = 30 )
658653 with p2p_lock :
659- test_node .last_message ["block" ].block .calc_sha256 ()
660654 assert_equal (test_node .last_message ["block" ].block .sha256 , int (new_blocks [0 ], 16 ))
661655
662656 # Generate an old compactblock, and verify that it's not accepted.
@@ -705,7 +699,6 @@ def test_end_to_end_block_relay(self, listeners):
705699 l .wait_until (lambda : "cmpctblock" in l .last_message , timeout = 30 )
706700 with p2p_lock :
707701 for l in listeners :
708- l .last_message ["cmpctblock" ].header_and_shortids .header .calc_sha256 ()
709702 assert_equal (l .last_message ["cmpctblock" ].header_and_shortids .header .sha256 , block .sha256 )
710703
711704 # Test that we don't get disconnected if we relay a compact block with valid header,
0 commit comments