Fix non-BTS MIA core_exchange_rate check #480

This commit is contained in:
theoreticalbts 2015-12-15 11:38:40 -05:00
parent 09855166a2
commit f42bbcd087
3 changed files with 16 additions and 1 deletions

View file

@ -491,6 +491,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( !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 ); 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 //Verify that the publisher is authoritative to publish a feed
if( base.options.flags & witness_fed_asset ) if( base.options.flags & witness_fed_asset )

View file

@ -27,3 +27,5 @@
#define HARDFORK_415_TIME (fc::time_point_sec( 1446652800 )) #define HARDFORK_415_TIME (fc::time_point_sec( 1446652800 ))
#define HARDFORK_416_TIME (fc::time_point_sec( 1446652800 )) #define HARDFORK_416_TIME (fc::time_point_sec( 1446652800 ))
#define HARDFORK_419_TIME (fc::time_point_sec( 1446652800 )) #define HARDFORK_419_TIME (fc::time_point_sec( 1446652800 ))
#define HARDFORK_480_TIME (fc::time_point_sec( 1450378800 ))

View file

@ -136,7 +136,6 @@ void asset_publish_feed_operation::validate()const
if( (!feed.settlement_price.is_null()) && (!feed.core_exchange_rate.is_null()) ) 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.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() ); FC_ASSERT( !feed.settlement_price.is_null() );