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

Commit

Permalink
Merge pull request #6871 from EOSIO/sig-cpu-usage-1.7.x
Browse files Browse the repository at this point in the history
Signature cpu usage - v1.7.x
  • Loading branch information
heifner authored Mar 6, 2019
2 parents b41c77d + a8c1ced commit cb95019
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,9 @@ struct controller_impl {
transaction_trace_ptr trace;
try {
auto start = fc::time_point::now();
const bool check_auth = !self.skip_auth_check() && !trx->implicit;
// call recover keys so that trx->sig_cpu_usage is set correctly
const flat_set<public_key_type>& recovered_keys = check_auth ? trx->recover_keys( chain_id ) : flat_set<public_key_type>();
if( !explicit_billed_cpu_time ) {
fc::microseconds already_consumed_time( EOS_PERCENT(trx->sig_cpu_usage.count(), conf.sig_cpu_bill_pct) );

Expand Down Expand Up @@ -1029,10 +1032,10 @@ struct controller_impl {

trx_context.delay = fc::seconds(trn.delay_sec);

if( !self.skip_auth_check() && !trx->implicit ) {
if( check_auth ) {
authorization.check_authorization(
trn.actions,
trx->recover_keys( chain_id ),
recovered_keys,
{},
trx_context.delay,
[](){}
Expand Down

0 comments on commit cb95019

Please sign in to comment.