From 543959fa6405b3b6abe41342e4061f3db71e41d7 Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Thu, 25 Jun 2015 14:33:46 -0400 Subject: [PATCH] Fix #92 --- libraries/chain/asset_evaluator.cpp | 4 ++-- libraries/chain/db_update.cpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/chain/asset_evaluator.cpp b/libraries/chain/asset_evaluator.cpp index 5f3dd48a..01a4f5a2 100644 --- a/libraries/chain/asset_evaluator.cpp +++ b/libraries/chain/asset_evaluator.cpp @@ -308,7 +308,7 @@ void_result asset_update_feed_producers_evaluator::do_apply(const asset_update_f a.feeds[*itr]; a.update_median_feeds(db().head_block_time()); }); - + db().check_call_orders( o.asset_to_update(db()) ); return void_result(); } FC_CAPTURE_AND_RETHROW( (o) ) } @@ -425,7 +425,7 @@ void_result asset_publish_feeds_evaluator::do_apply(const asset_publish_feed_ope a.update_median_feeds(d.head_block_time()); }); - /// TODO: only do this if the median feed actually changed, otherwise there is no point + /// TODO: optimization: only do this if the median feed actually changed, otherwise there is no point db().check_call_orders( base ); return void_result(); diff --git a/libraries/chain/db_update.cpp b/libraries/chain/db_update.cpp index 637915a8..8890313d 100644 --- a/libraries/chain/db_update.cpp +++ b/libraries/chain/db_update.cpp @@ -222,9 +222,13 @@ void database::update_expired_feeds() auto& asset_idx = get_index_type(); for( const asset_bitasset_data_object* b : asset_idx ) if( b->feed_is_expired(head_block_time()) ) + { modify(*b, [this](asset_bitasset_data_object& a) { a.update_median_feeds(head_block_time()); }); + + check_call_orders( b->current_feed.settlement_price.base.asset_id(*this) ); + } } void database::update_withdraw_permissions()