Skip to content

Commit

Permalink
pending block: auto fallback to old runtime api if it fail
Browse files Browse the repository at this point in the history
  • Loading branch information
librelois authored and RomarQ committed Feb 23, 2024
1 parent 6c8bd19 commit cb9620a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions client/rpc/src/eth/pending.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ where
);

// Initialize the pending block header
match api.api_version::<dyn EthereumRuntimeRPCApi<B>>(best_hash)? {
Some(version) if version >= 6 => {
api.initialize_pending_block(best_hash, &pending_header)?;
}
_ => api.initialize_block(best_hash, &pending_header)?,
if api
.initialize_pending_block(best_hash, &pending_header)
.is_err()
{
api.initialize_block(best_hash, &pending_header)?
}

// Apply inherents to the pending block.
Expand Down

0 comments on commit cb9620a

Please sign in to comment.