Fixed resent packets not getting repacked
This commit is contained in:
		
							parent
							
								
									e82e6d56f1
								
							
						
					
					
						commit
						52a0447fea
					
				@ -172,8 +172,8 @@ class Packet:
 | 
				
			|||||||
                    # Packet proofs over links are not encrypted
 | 
					                    # Packet proofs over links are not encrypted
 | 
				
			||||||
                    self.ciphertext = self.data
 | 
					                    self.ciphertext = self.data
 | 
				
			||||||
                elif self.context == Packet.RESOURCE:
 | 
					                elif self.context == Packet.RESOURCE:
 | 
				
			||||||
                    # A resource takes care of symmetric
 | 
					                    # A resource takes care of encryption
 | 
				
			||||||
                    # encryption by itself
 | 
					                    # by itself
 | 
				
			||||||
                    self.ciphertext = self.data
 | 
					                    self.ciphertext = self.data
 | 
				
			||||||
                elif self.context == Packet.KEEPALIVE:
 | 
					                elif self.context == Packet.KEEPALIVE:
 | 
				
			||||||
                    # Keepalive packets contain no actual
 | 
					                    # Keepalive packets contain no actual
 | 
				
			||||||
@ -276,6 +276,10 @@ class Packet:
 | 
				
			|||||||
        :returns: A :ref:`RNS.PacketReceipt<api-packetreceipt>` instance if *create_receipt* was set to *True* when the packet was instantiated, if not returns *None*. If the packet could not be sent *False* is returned.
 | 
					        :returns: A :ref:`RNS.PacketReceipt<api-packetreceipt>` instance if *create_receipt* was set to *True* when the packet was instantiated, if not returns *None*. If the packet could not be sent *False* is returned.
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
        if self.sent:
 | 
					        if self.sent:
 | 
				
			||||||
 | 
					            # Re-pack the packet to obtain new ciphertext for
 | 
				
			||||||
 | 
					            # encrypted destinations
 | 
				
			||||||
 | 
					            self.pack()
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
            if RNS.Transport.outbound(self):
 | 
					            if RNS.Transport.outbound(self):
 | 
				
			||||||
                return self.receipt
 | 
					                return self.receipt
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user