[bitshares/bitshares-core] Fix for Issue 868 — Reset feeds when changing the backing asset from one asset to another (#882)

jmjatlanta commented on this pull request.

> + const auto& current_asset = *asset_itr;
+ // Incorrect witness & committee feeds can simply be removed.
+ // For non-witness-fed and non-committee-fed assets, set incorrect
+ // feeds to price(), since we can’t simply remove them. For more information:
+ // https://github.com/bitshares/bitshares-core/pull/832#issuecomment-384112633
+ bool is_witness_or_committee_fed = false;
+ if ( current_asset.options.flags & (witness_fed_asset | committee_fed_asset) )
+ is_witness_or_committee_fed = true;
+
+ // for each feed
+ const asset_bitasset_data_object& bitasset_data = current_asset.bitasset_data(db);
+ // NOTE: If HF343 and HF868 roll out at the same time
+ // you can remove this double, and the check_call_orders()
+ // below that relies on it. HF343 will take care of the issue
+ // and there is no need for the extra check_call_orders() call
+ auto old_price = bitasset_data.settlement_price;

Done

Добавить комментарий