Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #6975 from EOSIO/txn-gen-fix-dev
Browse files Browse the repository at this point in the history
Fix txn_test_gen_plugin crash on multiple create_test_accounts calls - develop
  • Loading branch information
heifner authored Mar 20, 2019
2 parents 756f3c7 + eef306c commit 276bdeb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/txn_test_gen_plugin/txn_test_gen_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ using io_work_t = boost::asio::executor_work_guard<boost::asio::io_context::exec
{std::string("/v1/" #api_name "/" #call_name), \
[this](string, string body, url_response_callback cb) mutable { \
if (body.empty()) body = "{}"; \
auto result_handler = [cb, body](const fc::exception_ptr& e) {\
/*plugin processes many transactions, report only first to avoid http_plugin having to deal with multiple responses*/ \
auto times_called = std::make_shared<std::atomic<size_t>>(0);\
auto result_handler = [times_called{std::move(times_called)}, cb, body](const fc::exception_ptr& e) mutable {\
if( ++(*times_called) > 1 ) return;\
if (e) {\
try {\
e->dynamic_rethrow_exception();\
Expand Down

0 comments on commit 276bdeb

Please sign in to comment.