Skip to content

Commit

Permalink
check plugin name on plugin_reload rpc call (#33582)
Browse files Browse the repository at this point in the history
* check plugin name on plugin_reload rpc call

* add name to error message
  • Loading branch information
fanatid authored Nov 1, 2023
1 parent 25a29c9 commit 808f67a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions geyser-plugin-manager/src/geyser_plugin_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,22 @@ impl GeyserPluginManager {
data: None,
})?;

// Then see if a plugin with this name already exists. If so, abort
if self
.plugins
.iter()
.any(|plugin| plugin.name().eq(new_plugin.name()))
{
return Err(jsonrpc_core::Error {
code: ErrorCode::InvalidRequest,
message: format!(
"There already exists a plugin named {} loaded, while reloading {name}. Did not load requested plugin",
new_plugin.name()
),
data: None,
});
}

// Attempt to on_load with new plugin
match new_plugin.on_load(new_parsed_config_file) {
// On success, push plugin and library
Expand Down

0 comments on commit 808f67a

Please sign in to comment.