Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Net plugin cleanup #6372

Merged
merged 3 commits into from
Nov 26, 2018
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,6 @@ namespace eosio {
public:
uint32_t just_send_it_max = 0;

vector<transaction_id_type> req_trx;

std::multimap<block_id_type, connection_ptr> received_blocks;
std::multimap<transaction_id_type, connection_ptr> received_transactions;

Expand Down Expand Up @@ -1619,17 +1617,17 @@ namespace eosio {
net_message msg(bsum);
uint32_t packsiz = fc::raw::pack_size(msg);
uint32_t msgsiz = packsiz + sizeof(packsiz);
notice_message pending_notify;
block_id_type bid = bsum.id();
uint32_t bnum = bsum.block_num();
pending_notify.known_blocks.mode = normal;
pending_notify.known_blocks.ids.push_back( bid );
pending_notify.known_trx.mode = none;

peer_block_state pbstate = {bid, bnum, false,true,time_point()};
// skip will be empty if our producer emitted this block so just send it
if (( large_msg_notify && msgsiz > just_send_it_max) && !skips.empty()) {
fc_ilog(logger, "block size is ${ms}, sending notify",("ms", msgsiz));
notice_message pending_notify;
pending_notify.known_blocks.mode = normal;
pending_notify.known_blocks.ids.push_back( bid );
pending_notify.known_trx.mode = none;
my_impl->send_all(pending_notify, [&skips, pbstate](connection_ptr c) -> bool {
if (skips.find(c) != skips.end() || !c->current())
return false;
Expand All @@ -1648,7 +1646,7 @@ namespace eosio {
continue;
}
cp->add_peer_block(pbstate);
cp->enqueue( bsum );
cp->enqueue( msg );
}
}
}
Expand Down Expand Up @@ -1684,13 +1682,6 @@ namespace eosio {
}
received_transactions.erase(range.first, range.second);

for (auto ref = req_trx.begin(); ref != req_trx.end(); ++ref) {
if (*ref == id) {
req_trx.erase(ref);
break;
}
}

if( my_impl->local_txns.get<by_id>().find( id ) != my_impl->local_txns.end( ) ) { //found
fc_dlog(logger, "found trxid in local_trxs" );
return;
Expand Down Expand Up @@ -1797,7 +1788,6 @@ namespace eosio {
time_point()} );

req.req_trx.ids.push_back( t );
req_trx.push_back( t );
}
else {
fc_dlog(logger,"big msg manager found txn id in table, ${id}",("id", t));
Expand Down