Merge pull request #189 from Erethon/master

Fix bug where announce_identity could be undefined
This commit is contained in:
markqvist 2023-02-02 10:41:42 +01:00 committed by GitHub
commit 3b2fbe02c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1427,12 +1427,12 @@ class Transport:
# Check that the announced destination matches # Check that the announced destination matches
# the handlers aspect filter # the handlers aspect filter
execute_callback = False execute_callback = False
announce_identity = RNS.Identity.recall(packet.destination_hash)
if handler.aspect_filter == None: if handler.aspect_filter == None:
# If the handlers aspect filter is set to # If the handlers aspect filter is set to
# None, we execute the callback in all cases # None, we execute the callback in all cases
execute_callback = True execute_callback = True
else: else:
announce_identity = RNS.Identity.recall(packet.destination_hash)
handler_expected_hash = RNS.Destination.hash_from_name_and_identity(handler.aspect_filter, announce_identity) handler_expected_hash = RNS.Destination.hash_from_name_and_identity(handler.aspect_filter, announce_identity)
if packet.destination_hash == handler_expected_hash: if packet.destination_hash == handler_expected_hash:
execute_callback = True execute_callback = True