mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-10 09:06:15 +01:00
Remove unused CRPCSignals
They are no longer used for anything since RPCNotifyBlockChange was replaced with waitTipChanged() from the mining interface.
This commit is contained in:
parent
dca923150e
commit
460687a09c
3 changed files with 3 additions and 38 deletions
12
src/init.cpp
12
src/init.cpp
|
@ -429,16 +429,6 @@ static void registerSignalHandler(int signal, void(*handler)(int))
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void OnRPCStarted()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void OnRPCStopped()
|
|
||||||
{
|
|
||||||
g_best_block_cv.notify_all();
|
|
||||||
LogDebug(BCLog::RPC, "RPC stopped.\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetupServerArgs(ArgsManager& argsman, bool can_listen_ipc)
|
void SetupServerArgs(ArgsManager& argsman, bool can_listen_ipc)
|
||||||
{
|
{
|
||||||
SetupHelpOptions(argsman);
|
SetupHelpOptions(argsman);
|
||||||
|
@ -719,8 +709,6 @@ static void StartupNotify(const ArgsManager& args)
|
||||||
static bool AppInitServers(NodeContext& node)
|
static bool AppInitServers(NodeContext& node)
|
||||||
{
|
{
|
||||||
const ArgsManager& args = *Assert(node.args);
|
const ArgsManager& args = *Assert(node.args);
|
||||||
RPCServer::OnStarted(&OnRPCStarted);
|
|
||||||
RPCServer::OnStopped(&OnRPCStopped);
|
|
||||||
if (!InitHTTPServer(*Assert(node.shutdown))) {
|
if (!InitHTTPServer(*Assert(node.shutdown))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,7 @@
|
||||||
#include <util/strencodings.h>
|
#include <util/strencodings.h>
|
||||||
#include <util/string.h>
|
#include <util/string.h>
|
||||||
#include <util/time.h>
|
#include <util/time.h>
|
||||||
|
#include <validation.h>
|
||||||
#include <boost/signals2/signal.hpp>
|
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
@ -70,22 +69,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 CRPCTable::help(const std::string& strCommand, const JSONRPCRequest& helpreq) const
|
||||||
{
|
{
|
||||||
std::string strRet;
|
std::string strRet;
|
||||||
|
@ -298,7 +281,6 @@ void StartRPC()
|
||||||
{
|
{
|
||||||
LogDebug(BCLog::RPC, "Starting RPC\n");
|
LogDebug(BCLog::RPC, "Starting RPC\n");
|
||||||
g_rpc_running = true;
|
g_rpc_running = true;
|
||||||
g_rpcSignals.Started();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InterruptRPC()
|
void InterruptRPC()
|
||||||
|
@ -321,10 +303,11 @@ void StopRPC(const std::any& context)
|
||||||
LogDebug(BCLog::RPC, "Stopping RPC\n");
|
LogDebug(BCLog::RPC, "Stopping RPC\n");
|
||||||
WITH_LOCK(g_deadline_timers_mutex, deadlineTimers.clear());
|
WITH_LOCK(g_deadline_timers_mutex, deadlineTimers.clear());
|
||||||
DeleteAuthCookie();
|
DeleteAuthCookie();
|
||||||
g_rpcSignals.Stopped();
|
g_best_block_cv.notify_all();
|
||||||
node::NodeContext& node = EnsureAnyNodeContext(context);
|
node::NodeContext& node = EnsureAnyNodeContext(context);
|
||||||
// The notifications interface doesn't exist between initialization step 4a and 7.
|
// The notifications interface doesn't exist between initialization step 4a and 7.
|
||||||
if (node.notifications) node.notifications->m_tip_block_cv.notify_all();
|
if (node.notifications) node.notifications->m_tip_block_cv.notify_all();
|
||||||
|
LogDebug(BCLog::RPC, "RPC stopped.\n");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,12 +19,6 @@
|
||||||
|
|
||||||
class CRPCCommand;
|
class CRPCCommand;
|
||||||
|
|
||||||
namespace RPCServer
|
|
||||||
{
|
|
||||||
void OnStarted(std::function<void ()> slot);
|
|
||||||
void OnStopped(std::function<void ()> slot);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Query whether RPC is running */
|
/** Query whether RPC is running */
|
||||||
bool IsRPCRunning();
|
bool IsRPCRunning();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue