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

Signature cpu usage - dev #6872

Merged
merged 1 commit into from
Mar 6, 2019
Merged
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
7 changes: 5 additions & 2 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,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 @@ -1024,10 +1027,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