Skip to content

Commit 71e7658

Browse files
refactor: pass large structure by const reference on every RPC call (dashpay#5780)
1 parent 234d090 commit 71e7658

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rpc/server.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static RPCTimerInterface* timerInterface = nullptr;
3030
/* Map of name to timer. */
3131
static Mutex g_deadline_timers_mutex;
3232
static std::map<std::string, std::unique_ptr<RPCTimerBase> > deadlineTimers GUARDED_BY(g_deadline_timers_mutex);
33-
static bool ExecuteCommand(const CRPCCommand& command, const JSONRPCRequest& request, UniValue& result, bool last_handler, std::multimap<std::string, std::vector<UniValue>> mapPlatformRestrictions);
33+
static bool ExecuteCommand(const CRPCCommand& command, const JSONRPCRequest& request, UniValue& result, bool last_handler, const std::multimap<std::string, std::vector<UniValue>>& mapPlatformRestrictions);
3434

3535
// Any commands submitted by this user will have their commands filtered based on the mapPlatformRestrictions
3636
static const std::string defaultPlatformUser = "platform-user";
@@ -503,7 +503,7 @@ UniValue CRPCTable::execute(const JSONRPCRequest &request) const
503503
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Method not found");
504504
}
505505

506-
static bool ExecuteCommand(const CRPCCommand& command, const JSONRPCRequest& request, UniValue& result, bool last_handler, std::multimap<std::string, std::vector<UniValue>> mapPlatformRestrictions)
506+
static bool ExecuteCommand(const CRPCCommand& command, const JSONRPCRequest& request, UniValue& result, bool last_handler, const std::multimap<std::string, std::vector<UniValue>>& mapPlatformRestrictions)
507507
{
508508
// Before executing the RPC Command, filter commands from platform rpc user
509509
if (fMasternodeMode && request.authUser == gArgs.GetArg("-platform-user", defaultPlatformUser)) {

0 commit comments

Comments
 (0)