File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -28,16 +28,17 @@ def mine_large_blocks(node, n):
28
28
# followed by 950k of OP_NOP. This would be non-standard in a non-coinbase
29
29
# transaction but is consensus valid.
30
30
31
+ # Set the nTime if this is the first time this function has been called.
32
+ # A static variable ensures that time is monotonicly increasing and is therefore
33
+ # different for each block created => blockhash is unique.
34
+ if "nTimes" not in mine_large_blocks .__dict__ :
35
+ mine_large_blocks .nTime = 0
36
+
31
37
# Get the block parameters for the first block
32
38
big_script = CScript ([OP_RETURN ] + [OP_NOP ] * 950000 )
33
39
best_block = node .getblock (node .getbestblockhash ())
34
40
height = int (best_block ["height" ]) + 1
35
- try :
36
- # Static variable ensures that time is monotonicly increasing and is therefore
37
- # different for each block created => blockhash is unique.
38
- mine_large_blocks .nTime = min (mine_large_blocks .nTime , int (best_block ["time" ])) + 1
39
- except AttributeError :
40
- mine_large_blocks .nTime = int (best_block ["time" ]) + 1
41
+ mine_large_blocks .nTime = max (mine_large_blocks .nTime , int (best_block ["time" ])) + 1
41
42
previousblockhash = int (best_block ["hash" ], 16 )
42
43
43
44
for _ in range (n ):
You can’t perform that action at this time.
0 commit comments