Skip to content

Commit

Permalink
resolve peer ID to identity name from available name map;
Browse files Browse the repository at this point in the history
  • Loading branch information
gatekeep committed Nov 7, 2024
1 parent 05fa1c2 commit 38492cf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/sysview/network/PeerNetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ void PeerNetwork::userPacketHandler(uint32_t peerId, FrameQueue::OpcodePair opco

bool currState = g_disableTimeDisplay;
g_disableTimeDisplay = true;
::Log(9999U, nullptr, "%.9u %s", peerId, payload.c_str());

std::string identity = std::string();
auto it = std::find_if(g_peerIdentityNameMap.begin(), g_peerIdentityNameMap.end(), [&](PeerIdentityMapPair x) { return x.first == peerId; });
if (it != g_peerIdentityNameMap.end())
identity = g_peerIdentityNameMap[peerId];

::Log(9999U, nullptr, "%.9u (%8s) %s", peerId, identity.c_str(), payload.c_str());
g_disableTimeDisplay = currState;
}
break;
Expand Down

0 comments on commit 38492cf

Please sign in to comment.