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

PORT Consolidated Security Fixes for 1.2.6 to 1.3.0 #5734

Merged
merged 1 commit into from
Sep 18, 2018
Merged
Changes from all 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
13 changes: 5 additions & 8 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1344,19 +1344,16 @@ namespace eosio {
}

//scan the list of peers looking for another able to provide sync blocks.
while (cptr != cend) {
auto cstart_it = cptr;
do {
//select the first one which is current and break out.
if ((*cptr)->current()) {
if((*cptr)->current()) {
source = *cptr;
break;
}
else {
// advance the iterator in a round robin fashion.
if (++cptr == my_impl->connections.end()) {
if(++cptr == my_impl->connections.end())
cptr = my_impl->connections.begin();
}
}
}
} while(cptr != cstart_it);
// no need to check the result, either source advanced or the whole list was checked and the old source is reused.
}
}
Expand Down