File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -159,14 +159,18 @@ where
159159
160160 // if we've extracted a block ID, check if it's pre-Bedrock
161161 if let Some ( block_id) = maybe_block_id {
162- let is_pre_bedrock = if let Ok ( Some ( num) ) =
163- historical. provider . block_number_for_id ( block_id)
164- {
165- num < historical. bedrock_block
166- } else {
167- // If we can't convert the hash to a number, assume it's post-Bedrock
168- debug ! ( target: "rpc::historical" , ?block_id, "hash unknown; not forwarding" ) ;
169- false
162+ let is_pre_bedrock = match historical. provider . block_number_for_id ( block_id) {
163+ Ok ( Some ( num) ) => num < historical. bedrock_block ,
164+ Ok ( None ) if block_id. is_hash ( ) => {
165+ // if we couldn't find the block number for the hash then we assume it is
166+ // pre-Bedrock
167+ true
168+ }
169+ _ => {
170+ // If we can't convert blockid to a number, assume it's post-Bedrock
171+ debug ! ( target: "rpc::historical" , ?block_id, "hash unknown; not forwarding" ) ;
172+ false
173+ }
170174 } ;
171175
172176 // if the block is pre-Bedrock, forward the request to the historical client
You can’t perform that action at this time.
0 commit comments