Do not accept new offers if our contentQueue is full (#1753)

This commit is contained in:
Kim De Mey 2023-09-16 16:06:11 +02:00 committed by GitHub
parent cd1d370543
commit a65b1c9062
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -369,7 +369,7 @@ proc handleOffer(p: PortalProtocol, o: OfferMessage, srcId: NodeId): seq[byte] =
return @[] return @[]
let connectionId = let connectionId =
if contentKeysBitList.countOnes() != 0: if contentKeysBitList.countOnes() != 0 and not p.stream.contentQueue.full():
p.stream.addContentOffer(srcId, contentKeys) p.stream.addContentOffer(srcId, contentKeys)
else: else:
# When the node does not accept any of the content offered, reply with an # When the node does not accept any of the content offered, reply with an