exit early when empty params array

This commit is contained in:
Bryan Stitt 2023-08-15 16:20:25 -07:00
parent b742a25729
commit 70d75d5acb

@ -255,6 +255,16 @@ impl CacheMode {
});
}
if let Some(params) = params.as_array() {
if params.is_empty() {
// no params given. cache with the head block
return Ok(Self::Cache {
block: head_block.into(),
cache_errors: true,
});
}
}
match method {
"net_listening" => Ok(CacheMode::CacheSuccessForever),
"net_version" => Ok(CacheMode::CacheSuccessForever),