Browse Source

update alethzero mainwin

cl-refactor
subtly 10 years ago
parent
commit
ff26827108
  1. 4
      alethzero/MainWin.cpp
  2. 9
      libp2p/Peer.h

4
alethzero/MainWin.cpp

@ -965,8 +965,8 @@ void Main::refreshNetwork()
.arg(QString::fromStdString(i.id.abridged()))
.arg(QString::fromStdString(i.peerEndpoint().address().to_string()))
.arg(i.id == web3()->id() ? "self" : sessions.count(i.id) ? sessions[i.id] : "disconnected")
.arg(i.isOffline() ? " | " + QString::fromStdString(reasonOf(i.lastDisconnect)) + " | " + QString::number(i.failedAttempts) + "x" : "")
.arg(i.rating)
.arg(i.isOffline() ? " | " + QString::fromStdString(reasonOf(i.lastDisconnect())) + " | " + QString::number(i.failedAttempts()) + "x" : "")
.arg(i.rating())
);
}
}

9
libp2p/Peer.h

@ -62,6 +62,15 @@ public:
virtual bool operator<(Peer const& _p) const;
/// This peers rating.
int rating() const { return m_rating; }
/// Number of times connection has been attempted to peer.
int failedAttempts() const { return m_failedAttempts; }
/// Reason peer was previously disconnected.
DisconnectReason lastDisconnect() const { return m_lastDisconnect; }
protected:
int m_score = 0; ///< All time cumulative.
int m_rating = 0; ///< Trending.

Loading…
Cancel
Save