aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-08-15 17:53:42 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-08-15 17:53:42 -0500
commit05485bd1c50cec3d9eacdb0bb6da64b0644cb5cc (patch)
tree2b6fd29f5114d893e0c9dbb76b2530c29348618b /src
parentMerge pull request #4188 (diff)
parentblockchain_blackball: allow resumable interrupt with ^C (diff)
downloadmonero-05485bd1c50cec3d9eacdb0bb6da64b0644cb5cc.tar.xz
Merge pull request #4192
5860611 blockchain_blackball: allow resumable interrupt with ^C (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/blockchain_utilities/blockchain_blackball.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/blockchain_utilities/blockchain_blackball.cpp b/src/blockchain_utilities/blockchain_blackball.cpp
index 52d2938cd..65b6384dc 100644
--- a/src/blockchain_utilities/blockchain_blackball.cpp
+++ b/src/blockchain_utilities/blockchain_blackball.cpp
@@ -404,6 +404,11 @@ int main(int argc, char* argv[])
cryptonote::block b = core_storage[0]->get_db().get_block_from_height(0);
tools::ringdb ringdb(output_file_path.string(), epee::string_tools::pod_to_hex(get_block_hash(b)));
+ bool stop_requested = false;
+ tools::signal_handler::install([&stop_requested](int type) {
+ stop_requested = true;
+ });
+
for (size_t n = 0; n < inputs.size(); ++n)
{
const std::string canonical = boost::filesystem::canonical(inputs[n]).string();
@@ -489,9 +494,17 @@ int main(int argc, char* argv[])
}
state.relative_rings[txin.k_image] = new_ring;
}
+ if (stop_requested)
+ {
+ MINFO("Stopping scan, secondary passes will still happen...");
+ return false;
+ }
return true;
});
+ LOG_PRINT_L0("blockchain from " << inputs[n] << " processed still height " << start_idx);
state.processed_heights[canonical] = start_idx;
+ if (stop_requested)
+ break;
}
while (!newly_spent.empty())