File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -2329,9 +2329,7 @@ UniValue dumptxoutset(const JSONRPCRequest& request)
2329
2329
unsigned int iter{0 };
2330
2330
2331
2331
while (pcursor->Valid ()) {
2332
- if (iter % 5000 == 0 && !IsRPCRunning ()) {
2333
- throw JSONRPCError (RPC_CLIENT_NOT_CONNECTED, " Shutting down" );
2334
- }
2332
+ if (iter % 5000 == 0 ) RpcInterruptionPoint ();
2335
2333
++iter;
2336
2334
if (pcursor->GetKey (key) && pcursor->GetValue (coin)) {
2337
2335
afile << key;
Original file line number Diff line number Diff line change 11
11
#include < util/strencodings.h>
12
12
#include < util/system.h>
13
13
14
- #include < boost/signals2/signal.hpp>
15
14
#include < boost/algorithm/string/classification.hpp>
16
15
#include < boost/algorithm/string/split.hpp>
16
+ #include < boost/signals2/signal.hpp>
17
17
18
18
#include < memory> // for unique_ptr
19
19
#include < unordered_map>
@@ -309,6 +309,11 @@ bool IsRPCRunning()
309
309
return g_rpc_running;
310
310
}
311
311
312
+ void RpcInterruptionPoint ()
313
+ {
314
+ if (!IsRPCRunning ()) throw JSONRPCError (RPC_CLIENT_NOT_CONNECTED, " Shutting down" );
315
+ }
316
+
312
317
void SetRPCWarmupStatus (const std::string& newStatus)
313
318
{
314
319
LOCK (cs_rpcWarmup);
Original file line number Diff line number Diff line change 9
9
#include < amount.h>
10
10
#include < rpc/request.h>
11
11
12
+ #include < functional>
12
13
#include < map>
13
14
#include < stdint.h>
14
15
#include < string>
15
- #include < functional>
16
16
17
17
#include < univalue.h>
18
18
@@ -29,6 +29,9 @@ namespace RPCServer
29
29
/* * Query whether RPC is running */
30
30
bool IsRPCRunning ();
31
31
32
+ /* * Throw JSONRPCError if RPC is not running */
33
+ void RpcInterruptionPoint ();
34
+
32
35
/* *
33
36
* Set the RPC warmup status. When this is done, all RPC calls will error out
34
37
* immediately with RPC_IN_WARMUP.
You can’t perform that action at this time.
0 commit comments