提交 8a71b861 编写于 作者: A Anton Perkov

check max number of deferred transactions fix #1735

上级 948d3a16
......@@ -218,7 +218,7 @@ void apply_context::execute_deferred( deferred_transaction&& trx ) {
FC_ASSERT( !trx.actions.empty(), "transaction must have at least one action");
const auto& gpo = controller.get_global_properties();
FC_ASSERT( results.deferred_transaction_requests.size() < gpo.configuration.max_generated_transaction_count );
FC_ASSERT( results.deferred_transactions_count < gpo.configuration.max_generated_transaction_count );
// privileged accounts can do anything, no need to check auth
if( !privileged ) {
......@@ -240,6 +240,7 @@ void apply_context::execute_deferred( deferred_transaction&& trx ) {
trx.set_reference_block(controller.head_block_id());
results.deferred_transaction_requests.push_back(move(trx));
results.deferred_transactions_count++;
} FC_CAPTURE_AND_RETHROW((trx));
}
......
......@@ -524,6 +524,7 @@ class apply_context {
struct apply_results {
vector<action_trace> applied_actions;
vector<fc::static_variant<deferred_transaction, deferred_reference>> deferred_transaction_requests;
size_t deferred_transactions_count = 0;
};
apply_results results;
......@@ -575,6 +576,7 @@ class apply_context {
void append_results(apply_results &&other) {
fc::move_append(results.applied_actions, std::move(other.applied_actions));
fc::move_append(results.deferred_transaction_requests, std::move(other.deferred_transaction_requests));
results.deferred_transactions_count += other.deferred_transactions_count;
}
void exec_one();
......@@ -755,4 +757,4 @@ using apply_handler = std::function<void(apply_context&)>;
} } // namespace eosio::chain
FC_REFLECT(eosio::chain::apply_context::apply_results, (applied_actions)(deferred_transaction_requests))
FC_REFLECT(eosio::chain::apply_context::apply_results, (applied_actions)(deferred_transaction_requests)(deferred_transactions_count))
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册