Added resource HMU/part request hash filter. Fixes #7.

This commit is contained in:
Mark Qvist 2021-09-02 14:44:53 +02:00
parent 0c96508cca
commit 40f7a6d359
3 changed files with 7 additions and 2 deletions

View File

@ -651,6 +651,10 @@ class Link:
resource_hash = plaintext[1:RNS.Identity.HASHLENGTH//8+1]
for resource in self.outgoing_resources:
if resource.hash == resource_hash:
# We need to check that this request has not been
# received before in order to avoid sequencing errors.
if not packet.packet_hash in resource.req_hashlist:
resource.req_hashlist.append(packet.packet_hash)
resource.request(plaintext)
elif packet.context == RNS.Packet.RESOURCE_HMU:

View File

@ -192,6 +192,7 @@ class Resource:
self.request_id = request_id
self.is_response = is_response
self.req_hashlist = []
self.receiver_min_consecutive_height = 0
if timeout != None:

View File

@ -1 +1 @@
__version__ = "0.2.3"
__version__ = "0.2.4"