*Prevent recursive broadcast_request

This commit is contained in:
Derrick Hammer 2022-12-04 01:01:13 -05:00
parent 64611618de
commit d7897af137
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 7 additions and 0 deletions

View File

@ -93,6 +93,13 @@ const plugin: Plugin = {
throw new Error("relays required");
}
if (
req?.request?.module === "rpc" &&
req?.request?.method === "broadcast_request"
) {
throw new Error("recursive broadcast_request calls are not allowed");
}
let resp = await broadcastRequest(req.request, req.relays);
const result: RPCBroadcastResponse = {