Skip to content

Commit

Permalink
block_connected: re-use previous GetTimeMicros
Browse files Browse the repository at this point in the history
Shave off an extra 100 or so instructions from the
validation:block_connected tracepoint by reusing a nearby
GetTimeMicros(). This brings the tracepoint down to 54 instructions.
Still high, but much better than the previous ~154 and 8000 instructions
which it was originally.

Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
jb55 committed Jan 12, 2022
1 parent 80e1c55 commit eb8b22d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2166,7 +2166,7 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state,
block.vtx.size(),
nInputs,
nSigOpsCost,
GetTimeMicros() - nTimeStart // in microseconds (µs)
nTime5 - nTimeStart // in microseconds (µs)
);

return true;
Expand Down

0 comments on commit eb8b22d

Please sign in to comment.