diff --git a/runtime/src/error.rs b/runtime/src/error.rs index ddcec877a..7ae6aac3f 100644 --- a/runtime/src/error.rs +++ b/runtime/src/error.rs @@ -78,6 +78,10 @@ impl Error { }))) if module == BTC_RELAY_MODULE && error == DUPLICATE_BLOCK_ERROR ) } + + pub fn is_rpc_error(&self) -> bool { + matches!(self, Error::SubxtError(SubxtError::Rpc(_))) + } } #[derive(Error, Debug)] diff --git a/service/src/lib.rs b/service/src/lib.rs index b400a83f8..5c4ca666f 100644 --- a/service/src/lib.rs +++ b/service/src/lib.rs @@ -100,6 +100,7 @@ impl> ConnectionManager (), + Err(Error::RuntimeError(err)) if err.is_rpc_error() => (), Err(err) => return Err(err), }