@@ -148,7 +148,7 @@ bool node_impl::start(settings_type& config)
148148void node_impl::start_session ()
149149{
150150 // Start session
151- auto session_started = [this ](const std::error_code& ec)
151+ const auto session_started = [this ](const std::error_code& ec)
152152 {
153153 if (ec)
154154 wait_and_retry_start (ec);
@@ -170,14 +170,13 @@ bool node_impl::stop()
170170{
171171 // Stop session
172172 std::promise<std::error_code> ec_session;
173- auto session_stopped =
174- [&](const std::error_code& ec)
173+ const auto session_stopped = [&ec_session](const std::error_code& ec)
175174 {
176175 ec_session.set_value (ec);
177176 };
178177 session_.stop (session_stopped);
179178 // Query the error_code and wait for startup completion.
180- std::error_code ec = ec_session.get_future ().get ();
179+ const auto ec = ec_session.get_future ().get ();
181180 if (ec)
182181 log_error (LOG_NODE) << " Problem stopping session: " << ec.message ();
183182
@@ -248,13 +247,13 @@ void node_impl::recv_transaction(const std::error_code& ec,
248247 log_warning (LOG_NODE) << " recv_transaction: " << ec.message ();
249248 return ;
250249 }
251- auto handle_deindex = [](const std::error_code& ec)
250+ const auto handle_deindex = [](const std::error_code& ec)
252251 {
253252 if (ec)
254253 log_error (LOG_NODE) << " Deindex error: " << ec.message ();
255254 };
256255 // Called when the transaction becomes confirmed in a block.
257- auto handle_confirm = [this , tx, handle_deindex](
256+ const auto handle_confirm = [this , tx, handle_deindex](
258257 const std::error_code& ec)
259258 {
260259 log_debug (LOG_NODE) << " Confirm transaction: " << ec.message ()
@@ -282,15 +281,15 @@ void node_impl::handle_mempool_store(
282281 << encode_hash (hash_transaction (tx)) << " : " << ec.message ();
283282 return ;
284283 }
285- auto handle_index = [](const std::error_code& ec)
284+ const auto handle_index = [](const std::error_code& ec)
286285 {
287286 if (ec)
288287 log_error (LOG_NODE) << " Index error: " << ec.message ();
289288 };
290289 indexer_.index (tx, handle_index);
291290 log_info (LOG_NODE) << " Accepted transaction: "
292291 << encode_hash (hash_transaction (tx));
293- for (auto notify: notify_txs_)
292+ for (const auto notify: notify_txs_)
294293 notify (tx);
295294}
296295
@@ -306,7 +305,7 @@ void node_impl::reorganize(const std::error_code& /* ec */,
306305 {
307306 size_t height = fork_point + i + 1 ;
308307 const block_type& blk = *new_blocks[i];
309- for (auto notify: notify_blocks_)
308+ for (const auto notify: notify_blocks_)
310309 notify (height, blk);
311310 }
312311 chain_.subscribe_reorganize (
0 commit comments