saturating sub
This commit is contained in:
parent
d11d6c1f8a
commit
c6930dcb4c
@ -1642,7 +1642,7 @@ impl Web3ProxyApp {
|
|||||||
block,
|
block,
|
||||||
cache_errors,
|
cache_errors,
|
||||||
} => {
|
} => {
|
||||||
let block_depth = (head_block.number() - block.num()).as_u64();
|
let block_depth = (head_block.number().saturating_sub(block.num())).as_u64();
|
||||||
|
|
||||||
if block_depth < self.config.archive_depth {
|
if block_depth < self.config.archive_depth {
|
||||||
request_metadata
|
request_metadata
|
||||||
@ -1663,7 +1663,7 @@ impl Web3ProxyApp {
|
|||||||
to_block,
|
to_block,
|
||||||
cache_errors,
|
cache_errors,
|
||||||
} => {
|
} => {
|
||||||
let block_depth = (head_block.number() - from_block.num()).as_u64();
|
let block_depth = (head_block.number().saturating_sub(from_block.num())).as_u64();
|
||||||
|
|
||||||
if block_depth < self.config.archive_depth {
|
if block_depth < self.config.archive_depth {
|
||||||
request_metadata
|
request_metadata
|
||||||
|
Loading…
Reference in New Issue
Block a user