mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
fix(rpc): remove redundant TransportRpcModuleConfig clone in builder (#22945)
Co-authored-by: YK <chiayongkang@hotmail.com>
This commit is contained in:
@@ -394,20 +394,13 @@ where
|
||||
where
|
||||
EthApi: FullEthApiServer<Provider = Provider, Pool = Pool>,
|
||||
{
|
||||
let mut modules = TransportRpcModules::default();
|
||||
|
||||
if !module_config.is_empty() {
|
||||
let TransportRpcModuleConfig { http, ws, ipc, config } = module_config.clone();
|
||||
|
||||
let mut registry = self.into_registry(config.unwrap_or_default(), eth, engine_events);
|
||||
|
||||
modules.config = module_config;
|
||||
modules.http = registry.maybe_module(http.as_ref());
|
||||
modules.ws = registry.maybe_module(ws.as_ref());
|
||||
modules.ipc = registry.maybe_module(ipc.as_ref());
|
||||
if module_config.is_empty() {
|
||||
TransportRpcModules::default()
|
||||
} else {
|
||||
let config = module_config.config.clone().unwrap_or_default();
|
||||
let mut registry = self.into_registry(config, eth, engine_events);
|
||||
registry.create_transport_rpc_modules(module_config)
|
||||
}
|
||||
|
||||
modules
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user