Resolve #83: core_exchange_rate in feed updates on maintenance
This commit is contained in:
parent
dad1ca3bee
commit
dba009da4d
3 changed files with 4 additions and 9 deletions
|
|
@ -345,9 +345,6 @@ void_result asset_update_feed_producers_evaluator::do_apply(const asset_update_f
|
||||||
a.feeds[*itr];
|
a.feeds[*itr];
|
||||||
a.update_median_feeds(db().head_block_time());
|
a.update_median_feeds(db().head_block_time());
|
||||||
});
|
});
|
||||||
db().modify(o.asset_to_update(db()), [this](asset_object& a) {
|
|
||||||
a.options.core_exchange_rate = bitasset_to_update->current_feed.core_exchange_rate;
|
|
||||||
});
|
|
||||||
db().check_call_orders( o.asset_to_update(db()) );
|
db().check_call_orders( o.asset_to_update(db()) );
|
||||||
|
|
||||||
return void_result();
|
return void_result();
|
||||||
|
|
@ -464,9 +461,6 @@ void_result asset_publish_feeds_evaluator::do_apply(const asset_publish_feed_ope
|
||||||
a.feeds[o.publisher] = make_pair(d.head_block_time(), o.feed);
|
a.feeds[o.publisher] = make_pair(d.head_block_time(), o.feed);
|
||||||
a.update_median_feeds(d.head_block_time());
|
a.update_median_feeds(d.head_block_time());
|
||||||
});
|
});
|
||||||
d.modify(base, [&d](asset_object& a) {
|
|
||||||
a.options.core_exchange_rate = a.bitasset_data(d).current_feed.core_exchange_rate;
|
|
||||||
});
|
|
||||||
|
|
||||||
/// TODO: optimization: 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);
|
db().check_call_orders(base);
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,6 @@ void asset_object::bitasset_options::validate() const
|
||||||
FC_ASSERT(maximum_force_settlement_volume <= GRAPHENE_100_PERCENT);
|
FC_ASSERT(maximum_force_settlement_volume <= GRAPHENE_100_PERCENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
asset asset_object::amount_from_string(string amount_string) const
|
asset asset_object::amount_from_string(string amount_string) const
|
||||||
{ try {
|
{ try {
|
||||||
bool negative_found = false;
|
bool negative_found = false;
|
||||||
|
|
|
||||||
|
|
@ -231,11 +231,13 @@ void database::update_expired_feeds()
|
||||||
modify(b, [this](asset_bitasset_data_object& a) {
|
modify(b, [this](asset_bitasset_data_object& a) {
|
||||||
a.update_median_feeds(head_block_time());
|
a.update_median_feeds(head_block_time());
|
||||||
});
|
});
|
||||||
|
check_call_orders(b.current_feed.settlement_price.base.asset_id(*this));
|
||||||
|
}
|
||||||
|
if( !b.current_feed.core_exchange_rate.is_null() &&
|
||||||
|
a.options.core_exchange_rate != b.current_feed.core_exchange_rate )
|
||||||
modify(a, [&b](asset_object& a) {
|
modify(a, [&b](asset_object& a) {
|
||||||
a.options.core_exchange_rate = b.current_feed.core_exchange_rate;
|
a.options.core_exchange_rate = b.current_feed.core_exchange_rate;
|
||||||
});
|
});
|
||||||
check_call_orders(b.current_feed.settlement_price.base.asset_id(*this));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue