Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
limit the time spent traversing scheduled transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
b1bart committed Jul 14, 2018
1 parent 284f7aa commit 257badf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/chain_plugin/chain_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,8 @@ read_only::get_scheduled_transactions( const read_only::get_scheduled_transactio
auto resolver = make_resolver(this, abi_serializer_max_time);

uint32_t remaining = p.limit;
while (itr != idx_by_delay.end() && remaining > 0) {
auto time_limit = fc::time_point::now() + fc::microseconds(1000 * 10); /// 10ms max time
while (itr != idx_by_delay.end() && remaining > 0 && time_limit > fc::time_point::now()) {
auto row = fc::mutable_variant_object()
("trx_id", itr->trx_id)
("sender", itr->sender)
Expand Down

0 comments on commit 257badf

Please sign in to comment.