Skip to content

Commit

Permalink
Correct cpu_usage calculation when more than one signature
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Aug 27, 2019
1 parent 885ef13 commit 007ef41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/chain/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ fc::microseconds transaction::get_signature_keys( const vector<signature_type>&
if( it == recovery_cache.get<by_sig>().end() || it->trx_id != tid ) {
lock.unlock();
recov = public_key_type( sig, digest );
fc::microseconds cpu_usage = fc::time_point::now() - start;
fc::microseconds cpu_usage = fc::time_point::now() - start - sig_cpu_usage;
lock.lock();
recovery_cache.emplace_back( cached_pub_key{tid, recov, sig, cpu_usage} ); //could fail on dup signatures; not a problem
sig_cpu_usage += cpu_usage;
Expand Down

0 comments on commit 007ef41

Please sign in to comment.