Userlite mem comparison (#4552)

This commit is contained in:
Ben Meadors 2024-08-24 12:19:31 -05:00 committed by Kevin Hester
parent 059d5582d1
commit c11a66030f

View File

@ -1027,9 +1027,10 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde
#endif #endif
// Both of info->user and p start as filled with zero so I think this is okay // Both of info->user and p start as filled with zero so I think this is okay
bool changed = memcmp(&info->user, &p, sizeof(info->user)) || (info->channel != channelIndex); auto lite = TypeConversions::ConvertToUserLite(p);
bool changed = memcmp(&info->user, &lite, sizeof(info->user)) || (info->channel != channelIndex);
info->user = TypeConversions::ConvertToUserLite(p); info->user = lite;
if (info->user.public_key.size == 32) { if (info->user.public_key.size == 32) {
printBytes("Saved Pubkey: ", info->user.public_key.bytes, 32); printBytes("Saved Pubkey: ", info->user.public_key.bytes, 32);
} }