Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean feeds at maint time #598

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion libraries/chain/db_maint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -945,11 +945,26 @@ void database::perform_chain_maintenance(const signed_block& next_block, const g
});

// Reset all BitAsset force settlement volumes to zero

for( const auto& d : get_index_type<asset_bitasset_data_index>().indices() )
{
modify( d, [](asset_bitasset_data_object& o) { o.force_settled_volume = 0; });
modify( d, [this](asset_bitasset_data_object& o) {
o.force_settled_volume = 0;

// Remove all expired feeds
for( auto itr = o.feeds.begin(); itr != o.feeds.end();)
{
auto feed_time = itr[1].second.first;
if( feed_time + (o.options.feed_lifetime_sec) < head_block_time() && o.feeds.size() > o.options.minimum_feeds)
itr = o.feeds.erase(itr);
else
++itr;
}
//o.update_median_feeds(head_block_time());
});
if( d.has_settlement() )
process_bids(d);

}

// process_budget needs to run at the bottom because
Expand Down