Skip to content

Commit

Permalink
Remove bad peer addresses from the connection list immediately.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgiszczak committed May 22, 2018
1 parent bbcd651 commit 4dbd837
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1940,6 +1940,14 @@ namespace eosio {

if (colon == std::string::npos || colon == 0) {
elog ("Invalid peer address. must be \"host:port\": ${p}", ("p",c->peer_addr));
for ( auto itr : connections ) {
if((*itr).peer_addr == c->peer_addr) {
(*itr).reset();
close(itr);
connections.erase(itr);
break;
}
}
return;
}

Expand Down

0 comments on commit 4dbd837

Please sign in to comment.