Skip to content

Commit

Permalink
Adding system account active permission for delayed (boxed) transacti…
Browse files Browse the repository at this point in the history
…ons. GH EOSIO#1022
  • Loading branch information
brianjohnson5972 committed Mar 28, 2018
1 parent 9807563 commit 59c80b9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion libraries/chain/chain_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,20 @@ transaction_trace chain_controller::_push_transaction(const packed_transaction&
FC_ASSERT( trx.expiration > (head_block_time() + fc::milliseconds(2*config::block_interval_ms)),
"transaction is expired when created" );

apply_context context(*this, _db, trx.actions[0], mtrx);
// add in the system account authorization
action for_deferred = trx.actions[0];
bool found = false;
for (const auto& auth : for_deferred.authorization) {
if (auth.actor == config::system_account_name &&
auth.permission == config::active_name) {
found = true;
break;
}
}
if (!found)
for_deferred.authorization.push_back(permission_level{config::system_account_name, config::active_name});

apply_context context(*this, _db, for_deferred, mtrx);

time_point_sec execute_after = head_block_time();
execute_after += time_point_sec(delay);
Expand Down

0 comments on commit 59c80b9

Please sign in to comment.