diff options
| author | Wladimir J. van der Laan <[email protected]> | 2017-04-13 16:30:38 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2017-04-13 16:35:27 +0200 |
| commit | cf8a8b1028d683871a6267efc5be860d07a181a3 (patch) | |
| tree | 0e9e9c1b0b6620ea9f5b142b04cf32e86c5d71db /src | |
| parent | Merge #10165: [Wallet] Refactoring by using CInputCoin instead of std::pair (diff) | |
| parent | net: define NodeId as an int64_t (diff) | |
| download | discoin-cf8a8b1028d683871a6267efc5be860d07a181a3.tar.xz discoin-cf8a8b1028d683871a6267efc5be860d07a181a3.zip | |
Merge #10176: net: gracefully handle NodeId wrapping
c851be4 net: define NodeId as an int64_t (Cory Fields)
Tree-SHA512: 2ccc931cfcdc555313b9434d8de2f6cea759b31891212ca62f962208f60157d4fc593010e3ca61265d1a20d6f78c6ca79103600b85df77983d5509d192875b96
Diffstat (limited to 'src')
| -rw-r--r-- | src/net.h | 2 | ||||
| -rw-r--r-- | src/qt/peertablemodel.cpp | 2 | ||||
| -rw-r--r-- | src/qt/rpcconsole.cpp | 4 |
3 files changed, 4 insertions, 4 deletions
@@ -92,7 +92,7 @@ static const ServiceFlags REQUIRED_SERVICES = NODE_NETWORK; // NOTE: When adjusting this, update rpcnet:setban's help ("24h") static const unsigned int DEFAULT_MISBEHAVING_BANTIME = 60 * 60 * 24; // Default 24-hour ban -typedef int NodeId; +typedef int64_t NodeId; struct AddedNodeInfo { diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index 974a71ddc..fff072fd4 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -166,7 +166,7 @@ QVariant PeerTableModel::data(const QModelIndex &index, int role) const switch(index.column()) { case NetNodeId: - return rec->nodeStats.nodeid; + return (qint64)rec->nodeStats.nodeid; case Address: return QString::fromStdString(rec->nodeStats.addrName); case Subversion: diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 5167232d6..bb8aa23de 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -1118,7 +1118,7 @@ void RPCConsole::disconnectSelectedNode() for(int i = 0; i < nodes.count(); i++) { // Get currently selected peer address - NodeId id = nodes.at(i).data().toInt(); + NodeId id = nodes.at(i).data().toLongLong(); // Find the node, disconnect it and clear the selected node if(g_connman->DisconnectNode(id)) clearSelectedNode(); @@ -1135,7 +1135,7 @@ void RPCConsole::banSelectedNode(int bantime) for(int i = 0; i < nodes.count(); i++) { // Get currently selected peer address - NodeId id = nodes.at(i).data().toInt(); + NodeId id = nodes.at(i).data().toLongLong(); // Get currently selected peer address int detailNodeRow = clientModel->getPeerTableModel()->getRowByNodeId(id); |