File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -133,15 +133,12 @@ def check_clean_start():
133133
134134 for target_file in target_files :
135135 self .log .info (f"Perturbing file to ensure failure { target_file } " )
136- with open (target_file , "rb" ) as tf_read :
137- contents = tf_read .read ()
138- tweaked_contents = bytearray (contents )
136+ with open (target_file , "r+b" ) as tf :
139137 # Since the genesis block is not checked by -checkblocks, the
140138 # perturbation window must be chosen such that a higher block
141139 # in blk*.dat is affected.
142- tweaked_contents [150 :350 ] = b'1' * 200
143- with open (target_file , "wb" ) as tf_write :
144- tf_write .write (bytes (tweaked_contents ))
140+ tf .seek (150 )
141+ tf .write (b'1' * 200 )
145142
146143 start_expecting_error (err_fragment )
147144
You can’t perform that action at this time.
0 commit comments