1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-keygen synced 2026-06-17 03:50:03 +02:00

common/include/eoskeygen/key_search.hpp: adding abort()

This commit is contained in:
Henrik Hautakoski 2020-04-28 10:10:36 +02:00
parent 2a528e0eb0
commit 7c2545cdc2
2 changed files with 12 additions and 0 deletions

View file

@ -71,6 +71,12 @@ public :
void setThreadCount(size_t num);
#endif /* EOSIOKEYGEN_HAVE_THREADS */
// Aborts find() operation if started.
// This is useful for multithreaded code (like GUI application)
// If find() is started as a seperate thread. This method could be called
// from the gui thread if the user presses "cancel" button.
void abort();
// Perform a search.
void find(size_t num_results);

View file

@ -83,6 +83,12 @@ void KeySearch::_search_linear()
}
}
void KeySearch::abort()
{
// exit find() operation by setting m_max to zero.
m_max = 0;
}
void KeySearch::find(size_t num_results)
{
m_count = 0;