Suppress repeated Hash mismatch debug messages

This commit is contained in:
Atlante45 2014-11-05 23:08:00 +01:00
parent 7e36c51edc
commit 4460e23b68

View file

@ -209,8 +209,15 @@ bool LimitedNodeList::packetVersionAndHashMatch(const QByteArray& packet) {
if (hashFromPacketHeader(packet) == hashForPacketAndConnectionUUID(packet, sendingNode->getConnectionSecret())) { if (hashFromPacketHeader(packet) == hashForPacketAndConnectionUUID(packet, sendingNode->getConnectionSecret())) {
return true; return true;
} else { } else {
static QMultiMap<QUuid, PacketType> hashDebugSuppressMap;
QUuid senderUUID = uuidFromPacketHeader(packet);
if (!hashDebugSuppressMap.contains(senderUUID, checkType)) {
qDebug() << "Packet hash mismatch on" << checkType << "- Sender" qDebug() << "Packet hash mismatch on" << checkType << "- Sender"
<< uuidFromPacketHeader(packet); << uuidFromPacketHeader(packet);
hashDebugSuppressMap.insert(senderUUID, checkType);
}
} }
} else { } else {
static QString repeatedMessage static QString repeatedMessage