set max to head block of no to_block
This commit is contained in:
parent
6187d12493
commit
8f4a8ef4d5
@ -348,6 +348,7 @@ impl ValidatedRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// now that kafka has logged the user's original params, we can calculate the cache key
|
// now that kafka has logged the user's original params, we can calculate the cache key
|
||||||
|
// calculating the cache key might alter the params
|
||||||
|
|
||||||
// TODO: modify CacheMode::new to wait for a future block if one is requested! be sure to update head_block too!
|
// TODO: modify CacheMode::new to wait for a future block if one is requested! be sure to update head_block too!
|
||||||
let cache_mode = match &mut request {
|
let cache_mode = match &mut request {
|
||||||
@ -498,7 +499,13 @@ impl ValidatedRequest {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn max_block_needed(&self) -> Option<U64> {
|
pub fn max_block_needed(&self) -> Option<U64> {
|
||||||
self.cache_mode.to_block().map(|x| x.num())
|
if let Some(to_block) = self.cache_mode.to_block() {
|
||||||
|
Some(to_block.num())
|
||||||
|
} else {
|
||||||
|
self.head_block
|
||||||
|
.as_ref()
|
||||||
|
.map(|head_block| head_block.number())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
Loading…
Reference in New Issue
Block a user