Skip to content

Commit

Permalink
check plugin name on plugin_reload rpc call
Browse files Browse the repository at this point in the history
  • Loading branch information
fanatid committed Oct 7, 2023
1 parent c588f25 commit 592ee0a
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. 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 592ee0a

Please sign in to comment.