mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-19 23:31:03 +10:00
Ignore contacts with self public key in contact handling
This commit is contained in:
@@ -3766,6 +3766,14 @@ class MeshCoreConnector extends ChangeNotifier {
|
|||||||
void _handleContact(Uint8List frame, {bool isContact = true}) {
|
void _handleContact(Uint8List frame, {bool isContact = true}) {
|
||||||
final contactTmp = Contact.fromFrame(frame);
|
final contactTmp = Contact.fromFrame(frame);
|
||||||
if (contactTmp != null) {
|
if (contactTmp != null) {
|
||||||
|
if (listEquals(contactTmp.publicKey, _selfPublicKey)) {
|
||||||
|
appLogger.info(
|
||||||
|
'Ignoring contact with self public key: ${contactTmp.name}',
|
||||||
|
tag: 'Connector',
|
||||||
|
);
|
||||||
|
removeContact(contactTmp);
|
||||||
|
return;
|
||||||
|
}
|
||||||
final contact = getFromDiscovered(contactTmp);
|
final contact = getFromDiscovered(contactTmp);
|
||||||
_handleDiscovery(contact, frame, noNotify: true, addActive: true);
|
_handleDiscovery(contact, frame, noNotify: true, addActive: true);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user