Merge commit '92cfb96c618e1c051dd7a7224e5392d56c496c06' into betting

This commit is contained in:
Eric Frias 2017-06-20 16:39:27 -04:00
commit 8549cef70c
2 changed files with 36 additions and 3 deletions

View file

@ -3952,12 +3952,20 @@ namespace graphene { namespace net { namespace detail {
}
unsigned handle_message_call_count = 0;
for (fc::future<void>& handle_message_call : _handle_message_calls_in_progress)
while( true )
{
auto it = _handle_message_calls_in_progress.begin();
if( it == _handle_message_calls_in_progress.end() )
break;
if( it->ready() || it->error() || it->canceled() )
{
_handle_message_calls_in_progress.erase( it );
continue;
}
++handle_message_call_count;
try
{
handle_message_call.cancel_and_wait("node_impl::close()");
it->cancel_and_wait("node_impl::close()");
dlog("handle_message call #${count} task terminated", ("count", handle_message_call_count));
}
catch ( const fc::canceled_exception& )
@ -3973,7 +3981,6 @@ namespace graphene { namespace net { namespace detail {
wlog("Exception thrown while terminating handle_message call #${count} task, ignoring",("count", handle_message_call_count));
}
}
_handle_message_calls_in_progress.clear();
try
{

View file

@ -122,4 +122,30 @@ BOOST_AUTO_TEST_CASE( extended_public_key_type_test )
}
}
BOOST_AUTO_TEST_CASE( extension_serialization_test )
{
try
{
buyback_account_options bbo;
bbo.asset_to_buy = asset_id_type(1000);
bbo.asset_to_buy_issuer = account_id_type(2000);
bbo.markets.emplace( asset_id_type() );
bbo.markets.emplace( asset_id_type(777) );
account_create_operation create_op = make_account( "rex" );
create_op.registrar = account_id_type(1234);
create_op.extensions.value.buyback_options = bbo;
auto packed = fc::raw::pack( create_op );
account_create_operation unpacked = fc::raw::unpack<account_create_operation>(packed);
ilog( "original: ${x}", ("x", create_op) );
ilog( "unpacked: ${x}", ("x", unpacked) );
}
catch ( const fc::exception& e )
{
edump((e.to_detail_string()));
throw;
}
}
BOOST_AUTO_TEST_SUITE_END()