From 956d688e1009ee617c06c64f5f99ca41ee0b9991 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 24 Aug 2026 00:14:54 +0200 Subject: [PATCH] Check before cancel incoming --- RNS/Resource.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RNS/Resource.py b/RNS/Resource.py index 36167984..c22210d2 100644 --- a/RNS/Resource.py +++ b/RNS/Resource.py @@ -1085,7 +1085,7 @@ class Resource: if self.next_segment: self.next_segment.cancel() if self.status == Resource.CORRUPT: - self.link.cancel_incoming_resource(self) + if self in self.link.incoming_resources: self.link.cancel_incoming_resource(self) self.reject(self.advertisement_packet) self.link.teardown() @@ -1104,7 +1104,7 @@ class Resource: cancel_packet = RNS.Packet(self.link, self.hash, context=RNS.Packet.RESOURCE_RCL) cancel_packet.send() except Exception as e: RNS.log("Could not send resource cancel packet, the contained exception was: "+str(e), RNS.LOG_ERROR) - self.link.cancel_incoming_resource(self) + if self in self.link.incoming_resources: self.link.cancel_incoming_resource(self) if self.callback != None: try: