diff --git a/src/io/pipeer.cpp b/src/io/pipeer.cpp index 05db0d72..eb0676ae 100755 --- a/src/io/pipeer.cpp +++ b/src/io/pipeer.cpp @@ -112,12 +112,13 @@ void PIPeer::PeerInfo::destroy() { PIString PIPeer::PeerInfo::fastestAddress() const { double mp = -1.; PIString ret; - piForeachC (Address & a, addresses) - if (a.ping > 0.) { - if (mp < 0) mp = a.ping; - else mp = piMind(mp, a.ping); + piForeachC (Address & a, addresses) { + if (a.ping <= 0.) continue; + if ((mp < 0) || (mp > a.ping)) { + mp = a.ping; ret = a.address; } + } return ret; } @@ -756,6 +757,7 @@ void PIPeer::checkNetwork() { void PIPeer::initNetwork() { + eth_send.init(); destroyEths(); destroyMBcasts(); piCoutObj << "initNetwork";