Browse Source

neth: format peers

cl-refactor
caktux 11 years ago
parent
commit
cbcff4953f
  1. 14
      neth/main.cpp

14
neth/main.cpp

@ -947,14 +947,14 @@ int main(int argc, char** argv)
// Peers
y = 1;
string psc;
string pss;
auto cp = c.peers();
psc = toString(cp.size()) + " peer(s)";
for (PeerInfo const& i: cp)
for (PeerInfo const& i: c.peers())
{
pss = toString(chrono::duration_cast<chrono::milliseconds>(i.lastPing).count()) + " ms - " + i.host + ":" + toString(i.port) + " - " + i.clientVersion;
mvwaddnstr(peerswin, y++, x, pss.c_str(), qwidth);
auto s = boost::format("%1% ms - %2%:%3% - %4%") %
toString(chrono::duration_cast<chrono::milliseconds>(i.lastPing).count()) %
i.host %
toString(i.port) %
i.clientVersion;
mvwaddnstr(peerswin, y++, x, s.str().c_str(), qwidth);
if (y > height * 2 / 5 - 4)
break;
}

Loading…
Cancel
Save