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

Fix txn_test_gen_plugin crash on multiple create_test_accounts calls - develop #6975

Merged
merged 1 commit into from
Mar 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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