blockchain: add scope guard to waiter for threaded txv1 verification

This commit is contained in:
stoffu 2018-03-30 19:19:41 +09:00
parent 8361d60aef
commit 66a659bb03
No known key found for this signature in database
GPG Key ID: 41DAB8343A9EC012
1 changed files with 1 additions and 0 deletions

View File

@ -2658,6 +2658,7 @@ bool Blockchain::check_tx_inputs(transaction& tx, tx_verification_context &tvc,
tools::threadpool& tpool = tools::threadpool::getInstance(); tools::threadpool& tpool = tools::threadpool::getInstance();
tools::threadpool::waiter waiter; tools::threadpool::waiter waiter;
const auto waiter_guard = epee::misc_utils::create_scope_leave_handler([&]() { waiter.wait(); });
int threads = tpool.get_max_concurrency(); int threads = tpool.get_max_concurrency();
for (const auto& txin : tx.vin) for (const auto& txin : tx.vin)