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():
133
133
134
134
for target_file in target_files :
135
135
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 :
139
137
# Since the genesis block is not checked by -checkblocks, the
140
138
# perturbation window must be chosen such that a higher block
141
139
# 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 )
145
142
146
143
start_expecting_error (err_fragment )
147
144
You can’t perform that action at this time.
0 commit comments