Skip to content

Commit

Permalink
Defer block_in timer initialization until required.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Feb 9, 2024
1 parent afdc8bf commit b7964bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/protocols/protocol_block_in.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ void protocol_block_in::start() NOEXCEPT
if (started())
return;

start_ = steady_clock::now();
state_ = archive().get_confirmed_chain_state(config().bitcoin);

if (!state_)
Expand All @@ -119,7 +118,10 @@ void protocol_block_in::start() NOEXCEPT
}

if (report_performance_)
{
start_ = steady_clock::now();
performance_timer_->start(BIND1(handle_performance_timer, _1));
}

// There is one persistent common inventory subscription.
SUBSCRIBE_CHANNEL2(inventory, handle_receive_inventory, _1, _2);
Expand Down

0 comments on commit b7964bc

Please sign in to comment.