Skip to content

Commit

Permalink
Remove unused CRPCSignals
Browse files Browse the repository at this point in the history
They are no longer used for anything since RPCNotifyBlockChange was replaced with waitTipChanged() from the mining interface.
  • Loading branch information
Sjors committed Aug 26, 2024
1 parent 24de8a6 commit f11531d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 38 deletions.
12 changes: 0 additions & 12 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,16 +427,6 @@ static void registerSignalHandler(int signal, void(*handler)(int))
}
#endif

static void OnRPCStarted()
{
}

static void OnRPCStopped()
{
g_best_block_cv.notify_all();
LogPrint(BCLog::RPC, "RPC stopped.\n");
}

void SetupServerArgs(ArgsManager& argsman)
{
SetupHelpOptions(argsman);
Expand Down Expand Up @@ -714,8 +704,6 @@ static void StartupNotify(const ArgsManager& args)
static bool AppInitServers(NodeContext& node)
{
const ArgsManager& args = *Assert(node.args);
RPCServer::OnStarted(&OnRPCStarted);
RPCServer::OnStopped(&OnRPCStopped);
if (!InitHTTPServer(*Assert(node.shutdown))) {
return false;
}
Expand Down
23 changes: 3 additions & 20 deletions src/rpc/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
#include <util/strencodings.h>
#include <util/string.h>
#include <util/time.h>

#include <boost/signals2/signal.hpp>
#include <validation.h>

#include <cassert>
#include <chrono>
Expand Down Expand Up @@ -69,22 +68,6 @@ struct RPCCommandExecution
}
};

static struct CRPCSignals
{
boost::signals2::signal<void ()> Started;
boost::signals2::signal<void ()> Stopped;
} g_rpcSignals;

void RPCServer::OnStarted(std::function<void ()> slot)
{
g_rpcSignals.Started.connect(slot);
}

void RPCServer::OnStopped(std::function<void ()> slot)
{
g_rpcSignals.Stopped.connect(slot);
}

std::string CRPCTable::help(const std::string& strCommand, const JSONRPCRequest& helpreq) const
{
std::string strRet;
Expand Down Expand Up @@ -297,7 +280,6 @@ void StartRPC()
{
LogPrint(BCLog::RPC, "Starting RPC\n");
g_rpc_running = true;
g_rpcSignals.Started();
}

void InterruptRPC()
Expand All @@ -320,7 +302,8 @@ void StopRPC()
LogPrint(BCLog::RPC, "Stopping RPC\n");
WITH_LOCK(g_deadline_timers_mutex, deadlineTimers.clear());
DeleteAuthCookie();
g_rpcSignals.Stopped();
g_best_block_cv.notify_all();
LogPrint(BCLog::RPC, "RPC stopped.\n");
});
}

Expand Down
6 changes: 0 additions & 6 deletions src/rpc/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@

class CRPCCommand;

namespace RPCServer
{
void OnStarted(std::function<void ()> slot);
void OnStopped(std::function<void ()> slot);
}

/** Query whether RPC is running */
bool IsRPCRunning();

Expand Down

0 comments on commit f11531d

Please sign in to comment.