From 9cb181690eceed4e4f52cf5790cc302a840cd3a0 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Tue, 19 Mar 2024 11:52:32 +0100 Subject: [PATCH] Added link getter to resource advertisement class --- RNS/Resource.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RNS/Resource.py b/RNS/Resource.py index a739bc1..9422537 100644 --- a/RNS/Resource.py +++ b/RNS/Resource.py @@ -1023,6 +1023,7 @@ class ResourceAdvertisement: def __init__(self, resource=None, request_id=None, is_response=False): + self.link = None if resource != None: self.t = resource.size # Transfer size self.d = resource.total_size # Total uncompressed data size @@ -1069,6 +1070,9 @@ class ResourceAdvertisement: def is_compressed(self): return self.c + def get_link(self): + return self.link + def pack(self, segment=0): hashmap_start = segment*ResourceAdvertisement.HASHMAP_MAX_LEN hashmap_end = min((segment+1)*(ResourceAdvertisement.HASHMAP_MAX_LEN), self.n)