@@ -4082,19 +4082,19 @@ namespace eosio {
4082
4082
fc_dlog (logger, " on_accepted_block_header ${bn} ${id}" , (" bn" , block->block_num ())(" id" , id));
4083
4083
update_chain_info ();
4084
4084
4085
- boost::asio::post ( my_impl-> thread_pool .get_executor (), [block, id]() {
4085
+ boost::asio::post ( thread_pool.get_executor (), [block, id, this ]() {
4086
4086
fc_dlog (logger, " signaled accepted_block_header, blk num = ${num}, id = ${id}" , (" num" , block->block_num ())(" id" , id));
4087
- my_impl-> dispatcher .bcast_block (block, id);
4087
+ dispatcher.bcast_block (block, id);
4088
4088
});
4089
4089
}
4090
4090
4091
4091
void net_plugin_impl::on_accepted_block ( const signed_block_ptr& block, const block_id_type& id) {
4092
4092
fc_dlog (logger, " on_accepted_block ${bn} ${id}" , (" bn" , block->block_num ())(" id" , id));
4093
4093
update_chain_info ();
4094
4094
4095
- if (my_impl-> chain_plug ->chain ().get_read_mode () != db_read_mode::IRREVERSIBLE) {
4095
+ if (chain_plug->chain ().get_read_mode () != db_read_mode::IRREVERSIBLE) {
4096
4096
// irreversible notifies sync_manager when added to fork_db, non-irreversible notifies when applied
4097
- my_impl-> dispatcher .strand .post ([sync_master = my_impl-> sync_master .get (), block, id]() {
4097
+ dispatcher.strand .post ([sync_master = sync_master.get (), block, id]() {
4098
4098
const fc::microseconds age (fc::time_point::now () - block->timestamp );
4099
4099
sync_master->sync_recv_block (connection_ptr{}, id, block->block_num (), age);
4100
4100
});
@@ -4112,9 +4112,9 @@ namespace eosio {
4112
4112
fc_dlog ( logger, " on_irreversible_block, blk num = ${num}, id = ${id}" , (" num" , block->block_num ())(" id" , id) );
4113
4113
update_chain_info (id);
4114
4114
4115
- if (my_impl-> chain_plug ->chain ().get_read_mode () == db_read_mode::IRREVERSIBLE) {
4115
+ if (chain_plug->chain ().get_read_mode () == db_read_mode::IRREVERSIBLE) {
4116
4116
// irreversible notifies sync_manager when added to fork_db, non-irreversible notifies when applied
4117
- my_impl-> dispatcher .strand .post ([sync_master = my_impl-> sync_master .get (), block, id]() {
4117
+ dispatcher.strand .post ([sync_master = sync_master.get (), block, id]() {
4118
4118
const fc::microseconds age (fc::time_point::now () - block->timestamp );
4119
4119
sync_master->sync_recv_block (connection_ptr{}, id, block->block_num (), age);
4120
4120
});
@@ -4147,7 +4147,7 @@ namespace eosio {
4147
4147
case vote_result_t ::invalid_signature:
4148
4148
case vote_result_t ::max_exceeded: // close peer immediately
4149
4149
fc_elog (vote_logger, " Invalid vote(s), closing connection - ${c}" , (" c" , connection_id));
4150
- my_impl-> connections .any_of_connections ([connection_id](const connection_ptr& c) {
4150
+ connections.any_of_connections ([connection_id](const connection_ptr& c) {
4151
4151
if (c->connection_id == connection_id) {
4152
4152
c->close ( false );
4153
4153
return true ;
@@ -4158,7 +4158,7 @@ namespace eosio {
4158
4158
case vote_result_t ::unknown_block: // track the failure
4159
4159
fc_dlog (vote_logger, " connection - ${c} vote unknown block #${bn}:${id}.." ,
4160
4160
(" c" , connection_id)(" bn" , block_header::num_from_id (msg->block_id ))(" id" , msg->block_id .str ().substr (8 ,16 )));
4161
- my_impl-> connections .any_of_connections ([connection_id](const connection_ptr& c) {
4161
+ connections.any_of_connections ([connection_id](const connection_ptr& c) {
4162
4162
if (c->connection_id == connection_id) {
4163
4163
boost::asio::post (c->strand , [c]() {
4164
4164
c->block_status_monitor_ .rejected ();
@@ -4176,24 +4176,24 @@ namespace eosio {
4176
4176
}
4177
4177
4178
4178
void net_plugin_impl::bcast_vote_message ( uint32_t exclude_peer, const chain::vote_message_ptr& msg ) {
4179
- if (my_impl-> sync_master ->syncing_from_peer ())
4179
+ if (sync_master->syncing_from_peer ())
4180
4180
return ;
4181
4181
4182
4182
fc_dlog (vote_logger, " bcast ${t} vote: block #${bn} ${id}.., ${v}, key ${k}.." ,
4183
4183
(" t" , exclude_peer ? " received" : " our" )(" bn" , block_header::num_from_id (msg->block_id ))(" id" , msg->block_id .str ().substr (8 ,16 ))
4184
4184
(" v" , msg->strong ? " strong" : " weak" )(" k" , msg->finalizer_key .to_string ().substr (8 ,16 )));
4185
4185
4186
- boost::asio::post ( my_impl-> thread_pool .get_executor (), [exclude_peer, msg]() mutable {
4186
+ boost::asio::post ( thread_pool.get_executor (), [exclude_peer, msg, this ]() mutable {
4187
4187
buffer_factory buff_factory;
4188
4188
auto send_buffer = buff_factory.get_send_buffer ( *msg );
4189
4189
4190
- my_impl-> dispatcher .bcast_vote_msg ( exclude_peer, std::move (send_buffer) );
4190
+ dispatcher.bcast_vote_msg ( exclude_peer, std::move (send_buffer) );
4191
4191
});
4192
4192
}
4193
4193
4194
4194
// called from application thread
4195
4195
void net_plugin_impl::transaction_ack (const std::pair<fc::exception_ptr, packed_transaction_ptr>& results) {
4196
- boost::asio::post ( my_impl-> thread_pool .get_executor (), [&dispatcher = my_impl-> dispatcher , results]() {
4196
+ boost::asio::post ( thread_pool.get_executor (), [this , results]() {
4197
4197
const auto & id = results.second ->id ();
4198
4198
if (results.first ) {
4199
4199
fc_dlog ( logger, " signaled NACK, trx-id = ${id} : ${why}" , (" id" , id)( " why" , results.first ->to_detail_string () ) );
0 commit comments