From a775c54adf368b902c645437e32d6b188395822d Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sat, 11 Oct 2014 16:06:40 +0200 Subject: [PATCH] UX fixes to nodes view. --- alethzero/MainWin.cpp | 7 +++---- libp2p/Host.cpp | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index f55bf2d9f..e9dcf0ff6 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -767,14 +767,13 @@ void Main::refreshNetwork() ui->nodes->clear(); for (p2p::Node const& i: ns) if (!i.dead) - ui->nodes->addItem(QString("[%1%3] %2 - ( =%5s | /%4s | %6 | %7x ) - *%8 $%9") + ui->nodes->addItem(QString("[%1%3] %2 - ( =%5s | /%4s%6 ) - *%7 $%8") .arg(QString::fromStdString(i.id.abridged())) .arg(QString::fromStdString(toString(i.address))) - .arg(i.id == web3()->id() ? " self" : i.isOffline() ? " ripe" : " ----") + .arg(i.id == web3()->id() ? " self" : i.isOffline() ? QString::number(i.fallbackSeconds() - i.secondsSinceLastAttempted()) + "s" : " ----") .arg(i.secondsSinceLastAttempted()) .arg(i.secondsSinceLastConnected()) - .arg(QString::fromStdString(reasonOf(i.lastDisconnect))) - .arg(i.failedAttempts) + .arg(i.lastDisconnect == NoDisconnect ? QString("") : (" | " + QString::fromStdString(reasonOf(i.lastDisconnect)) + " | " + QString::number(i.failedAttempts) + "x")) .arg(i.rating) .arg((int)i.idOrigin) ); diff --git a/libp2p/Host.cpp b/libp2p/Host.cpp index b3b8cdbc1..85b0af81e 100644 --- a/libp2p/Host.cpp +++ b/libp2p/Host.cpp @@ -507,6 +507,7 @@ void Node::connect(Host* _h) { clog(NetConnect) << "Connection refused to node" << id.abridged() << "@" << address << "(" << ec.message() << ")"; lastDisconnect = TCPError; + lastAttempted = std::chrono::system_clock::now(); _h->m_ready += index; } else