Skip to content

Commit 460687a

Browse files
committed
Remove unused CRPCSignals
They are no longer used for anything since RPCNotifyBlockChange was replaced with waitTipChanged() from the mining interface.
1 parent dca9231 commit 460687a

File tree

3 files changed

+3
-38
lines changed

3 files changed

+3
-38
lines changed

src/init.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -429,16 +429,6 @@ static void registerSignalHandler(int signal, void(*handler)(int))
429429
}
430430
#endif
431431

432-
static void OnRPCStarted()
433-
{
434-
}
435-
436-
static void OnRPCStopped()
437-
{
438-
g_best_block_cv.notify_all();
439-
LogDebug(BCLog::RPC, "RPC stopped.\n");
440-
}
441-
442432
void SetupServerArgs(ArgsManager& argsman, bool can_listen_ipc)
443433
{
444434
SetupHelpOptions(argsman);
@@ -719,8 +709,6 @@ static void StartupNotify(const ArgsManager& args)
719709
static bool AppInitServers(NodeContext& node)
720710
{
721711
const ArgsManager& args = *Assert(node.args);
722-
RPCServer::OnStarted(&OnRPCStarted);
723-
RPCServer::OnStopped(&OnRPCStopped);
724712
if (!InitHTTPServer(*Assert(node.shutdown))) {
725713
return false;
726714
}

src/rpc/server.cpp

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
#include <util/strencodings.h>
2020
#include <util/string.h>
2121
#include <util/time.h>
22-
23-
#include <boost/signals2/signal.hpp>
22+
#include <validation.h>
2423

2524
#include <cassert>
2625
#include <chrono>
@@ -70,22 +69,6 @@ struct RPCCommandExecution
7069
}
7170
};
7271

73-
static struct CRPCSignals
74-
{
75-
boost::signals2::signal<void ()> Started;
76-
boost::signals2::signal<void ()> Stopped;
77-
} g_rpcSignals;
78-
79-
void RPCServer::OnStarted(std::function<void ()> slot)
80-
{
81-
g_rpcSignals.Started.connect(slot);
82-
}
83-
84-
void RPCServer::OnStopped(std::function<void ()> slot)
85-
{
86-
g_rpcSignals.Stopped.connect(slot);
87-
}
88-
8972
std::string CRPCTable::help(const std::string& strCommand, const JSONRPCRequest& helpreq) const
9073
{
9174
std::string strRet;
@@ -298,7 +281,6 @@ void StartRPC()
298281
{
299282
LogDebug(BCLog::RPC, "Starting RPC\n");
300283
g_rpc_running = true;
301-
g_rpcSignals.Started();
302284
}
303285

304286
void InterruptRPC()
@@ -321,10 +303,11 @@ void StopRPC(const std::any& context)
321303
LogDebug(BCLog::RPC, "Stopping RPC\n");
322304
WITH_LOCK(g_deadline_timers_mutex, deadlineTimers.clear());
323305
DeleteAuthCookie();
324-
g_rpcSignals.Stopped();
306+
g_best_block_cv.notify_all();
325307
node::NodeContext& node = EnsureAnyNodeContext(context);
326308
// The notifications interface doesn't exist between initialization step 4a and 7.
327309
if (node.notifications) node.notifications->m_tip_block_cv.notify_all();
310+
LogDebug(BCLog::RPC, "RPC stopped.\n");
328311
});
329312
}
330313

src/rpc/server.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919

2020
class CRPCCommand;
2121

22-
namespace RPCServer
23-
{
24-
void OnStarted(std::function<void ()> slot);
25-
void OnStopped(std::function<void ()> slot);
26-
}
27-
2822
/** Query whether RPC is running */
2923
bool IsRPCRunning();
3024

0 commit comments

Comments
 (0)