diff --git a/nano/slow_test/node.cpp b/nano/slow_test/node.cpp index 3bf832be9..57de06426 100644 --- a/nano/slow_test/node.cpp +++ b/nano/slow_test/node.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -112,7 +113,7 @@ TEST (ledger, deep_account_compute) } } -TEST (wallet, multithreaded_send) +TEST (wallet, multithreaded_send_async) { std::vector threads; { @@ -120,18 +121,23 @@ TEST (wallet, multithreaded_send) nano::keypair key; auto wallet_l (system.wallet (0)); wallet_l->insert_adhoc (nano::test_genesis_key.prv); + wallet_l->insert_adhoc (key.prv); for (auto i (0); i < 20; ++i) { threads.push_back (boost::thread ([wallet_l, &key]() { for (auto i (0); i < 1000; ++i) { - wallet_l->send_action (nano::test_genesis_key.pub, key.pub, 1000); + wallet_l->send_async (nano::test_genesis_key.pub, key.pub, 1000, [](std::shared_ptr block_a) { + ASSERT_FALSE (block_a == nullptr); + ASSERT_FALSE (block_a->hash ().is_zero ()); + }); } })); } + system.deadline_set (1000s); while (system.nodes[0]->balance (nano::test_genesis_key.pub) != (nano::genesis_amount - 20 * 1000 * 1000)) { - system.poll (); + ASSERT_NO_ERROR (system.poll ()); } } for (auto i (threads.begin ()), n (threads.end ()); i != n; ++i)