diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-05-29 17:21:56 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-05-29 17:22:07 -0400 |
commit | fa9c67559186f5416c1c0b26c0a1d5e72c234ccb (patch) | |
tree | 2d1978db3244baeaf39831857bb9929cf9740dfa /src/rpc | |
parent | cb88de3e3d37842199a17ba3d36838fc69fbe573 (diff) |
Limit scope of all global std::once_flag
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/server.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 2a0079ac39..844f62cbc6 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -22,8 +22,6 @@ static RecursiveMutex cs_rpcWarmup; static std::atomic<bool> g_rpc_running{false}; -static std::once_flag g_rpc_interrupt_flag; -static std::once_flag g_rpc_stop_flag; static bool fRPCInWarmup GUARDED_BY(cs_rpcWarmup) = true; static std::string rpcWarmupStatus GUARDED_BY(cs_rpcWarmup) = "RPC server started"; /* Timer-creating functions */ @@ -295,6 +293,7 @@ void StartRPC() void InterruptRPC() { + static std::once_flag g_rpc_interrupt_flag; // This function could be called twice if the GUI has been started with -server=1. std::call_once(g_rpc_interrupt_flag, []() { LogPrint(BCLog::RPC, "Interrupting RPC\n"); @@ -305,6 +304,7 @@ void InterruptRPC() void StopRPC() { + static std::once_flag g_rpc_stop_flag; // This function could be called twice if the GUI has been started with -server=1. assert(!g_rpc_running); std::call_once(g_rpc_stop_flag, []() { |