File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ use crate::prelude::*;
20
20
#[ cfg( debug_assertions) ]
21
21
use fail:: fail_point;
22
22
23
+ // A high number here forces a slow start.
24
+ const STARTING_PREVIOUS_TRIGGERS_PER_BLOCK : f64 = 1_000_000.0 ;
25
+
23
26
enum BlockStreamState < C >
24
27
where
25
28
C : Blockchain ,
@@ -178,9 +181,7 @@ where
178
181
filter,
179
182
start_blocks,
180
183
metrics,
181
-
182
- // A high number here forces a slow start, with a range of 1.
183
- previous_triggers_per_block : 1_000_000.0 ,
184
+ previous_triggers_per_block : STARTING_PREVIOUS_TRIGGERS_PER_BLOCK ,
184
185
previous_block_range_size : 1 ,
185
186
max_block_range_size,
186
187
target_triggers_per_block_range,
@@ -555,7 +556,8 @@ impl<C: Blockchain> Stream for PollingBlockStream<C> {
555
556
Poll :: Ready ( Err ( e) ) => {
556
557
// Reset the block range size in an attempt to recover from the error.
557
558
// See also: 018c6df4-132f-4acc-8697-a2d64e83a9f0
558
- self . ctx . previous_block_range_size = 1 ;
559
+ self . ctx . previous_triggers_per_block =
560
+ STARTING_PREVIOUS_TRIGGERS_PER_BLOCK ;
559
561
self . consecutive_err_count += 1 ;
560
562
561
563
// Pause before trying again
You can’t perform that action at this time.
0 commit comments