diff --git a/libraries/chain/asset_evaluator.cpp b/libraries/chain/asset_evaluator.cpp index 1f2826a00d..853c66f4c9 100644 --- a/libraries/chain/asset_evaluator.cpp +++ b/libraries/chain/asset_evaluator.cpp @@ -447,7 +447,9 @@ void_result asset_settle_evaluator::do_evaluate(const asset_settle_evaluator::op FC_ASSERT(asset_to_settle->can_force_settle() || bitasset.has_settlement() ); if( bitasset.is_prediction_market ) FC_ASSERT( bitasset.has_settlement(), "global settlement must occur before force settling a prediction market" ); - else if( bitasset.current_feed.settlement_price.is_null() ) + else if( bitasset.current_feed.settlement_price.is_null() + && ( d.head_block_time() <= HARDFORK_CORE_216_TIME + || !bitasset.has_settlement() ) ) FC_THROW_EXCEPTION(insufficient_feeds, "Cannot force settle with no price feed."); FC_ASSERT(d.get_balance(d.get(op.account), *asset_to_settle) >= op.amount); diff --git a/libraries/chain/hardfork.d/CORE_216.hf b/libraries/chain/hardfork.d/CORE_216.hf new file mode 100644 index 0000000000..91af76371b --- /dev/null +++ b/libraries/chain/hardfork.d/CORE_216.hf @@ -0,0 +1,4 @@ +// bitshares-core #216 Process to reset a Smartcoin after a Black Swan +#ifndef HARDFORK_CORE_216_TIME +#define HARDFORK_CORE_216_TIME (fc::time_point_sec( 1498762800 )) +#endif diff --git a/tests/tests/operation_tests.cpp b/tests/tests/operation_tests.cpp index 896e318aaf..e671724ec7 100644 --- a/tests/tests/operation_tests.cpp +++ b/tests/tests/operation_tests.cpp @@ -275,6 +275,7 @@ BOOST_AUTO_TEST_CASE( black_swan ) // make sure pricefeeds expire generate_blocks(db.head_block_time() + GRAPHENE_DEFAULT_PRICE_FEED_LIFETIME); + generate_blocks( HARDFORK_CORE_216_TIME ); generate_blocks(2); FC_ASSERT( bitusd_id(db).bitasset_data(db).current_feed.settlement_price.is_null() );