diff --git a/libraries/chain/asset_evaluator.cpp b/libraries/chain/asset_evaluator.cpp index b5239b7c..33476b79 100644 --- a/libraries/chain/asset_evaluator.cpp +++ b/libraries/chain/asset_evaluator.cpp @@ -502,6 +502,20 @@ void_result asset_publish_feeds_evaluator::do_evaluate(const asset_publish_feed_ FC_ASSERT( !bitasset.has_settlement(), "No further feeds may be published after a settlement event" ); FC_ASSERT( o.feed.settlement_price.quote.asset_id == bitasset.options.short_backing_asset ); + if( d.head_block_time() > HARDFORK_480_TIME ) + { + if( !o.feed.core_exchange_rate.is_null() ) + { + FC_ASSERT( o.feed.core_exchange_rate.quote.asset_id == asset_id_type() ); + } + } + else + { + if( (!o.feed.settlement_price.is_null()) && (!o.feed.core_exchange_rate.is_null()) ) + { + FC_ASSERT( o.feed.settlement_price.quote.asset_id == o.feed.core_exchange_rate.quote.asset_id ); + } + } //Verify that the publisher is authoritative to publish a feed if( base.options.flags & witness_fed_asset ) diff --git a/libraries/chain/include/graphene/chain/hardfork.hpp b/libraries/chain/include/graphene/chain/hardfork.hpp index 4095dd00..94c678b2 100644 --- a/libraries/chain/include/graphene/chain/hardfork.hpp +++ b/libraries/chain/include/graphene/chain/hardfork.hpp @@ -38,3 +38,6 @@ // #453 Hardfork to retroactively correct referral percentages #define HARDFORK_453_TIME (fc::time_point_sec( 1450288800 )) + +// #480 Fix non-CORE MIA core_exchange_rate check +#define HARDFORK_480_TIME (fc::time_point_sec( 1450378800 )) diff --git a/libraries/chain/protocol/asset_ops.cpp b/libraries/chain/protocol/asset_ops.cpp index c4cd433b..0a96163b 100644 --- a/libraries/chain/protocol/asset_ops.cpp +++ b/libraries/chain/protocol/asset_ops.cpp @@ -139,7 +139,6 @@ void asset_publish_feed_operation::validate()const if( (!feed.settlement_price.is_null()) && (!feed.core_exchange_rate.is_null()) ) { FC_ASSERT( feed.settlement_price.base.asset_id == feed.core_exchange_rate.base.asset_id ); - FC_ASSERT( feed.settlement_price.quote.asset_id == feed.core_exchange_rate.quote.asset_id ); } FC_ASSERT( !feed.settlement_price.is_null() );