Use const ref to vote in observers.vote.add lambda (#4926)

This commit is contained in:
Piotr Wójcik 2025-07-08 23:43:23 +02:00 committed by GitHub
commit 0d19dd449d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -267,7 +267,7 @@ nano::node::node (std::shared_ptr<boost::asio::io_context> io_ctx_a, std::filesy
});
// Representative is defined as online if replying to live votes or rep crawler queries
observers.vote.add ([this] (std::shared_ptr<nano::vote> vote, std::shared_ptr<nano::transport::channel> const & channel, nano::vote_source source, nano::vote_code code) {
observers.vote.add ([this] (std::shared_ptr<nano::vote> const & vote, std::shared_ptr<nano::transport::channel> const & channel, nano::vote_source source, nano::vote_code code) {
release_assert (vote != nullptr);
release_assert (channel != nullptr);
debug_assert (code != nano::vote_code::invalid);

View file

@ -1077,7 +1077,7 @@ nano::websocket_server::websocket_server (nano::websocket::config & config_a, na
}
});
observers.vote.add ([this] (std::shared_ptr<nano::vote> vote_a, std::shared_ptr<nano::transport::channel> const & channel_a, nano::vote_source source_a, nano::vote_code code_a) {
observers.vote.add ([this] (std::shared_ptr<nano::vote> const & vote_a, std::shared_ptr<nano::transport::channel> const & channel_a, nano::vote_source source_a, nano::vote_code code_a) {
debug_assert (vote_a != nullptr);
if (server->any_subscriber (nano::websocket::topic::vote))
{