rpc: factor out RpcInterruptionPoint from dumptxoutset

This commit is contained in:
MarcoFalke
2020-05-22 15:38:48 -04:00
parent b5c423c48e
commit fa7fc5a8e0
3 changed files with 11 additions and 5 deletions

View File

@@ -2329,9 +2329,7 @@ UniValue dumptxoutset(const JSONRPCRequest& request)
unsigned int iter{0};
while (pcursor->Valid()) {
if (iter % 5000 == 0 && !IsRPCRunning()) {
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Shutting down");
}
if (iter % 5000 == 0) RpcInterruptionPoint();
++iter;
if (pcursor->GetKey(key) && pcursor->GetValue(coin)) {
afile << key;