mirror of
				https://github.com/PurpleI2P/i2pd.git
				synced 2025-11-04 08:30:46 +00:00 
			
		
		
		
	don't replace an adddress by one with DSA signature
This commit is contained in:
		
							parent
							
								
									d8381e9486
								
							
						
					
					
						commit
						30d6bd144b
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -454,17 +454,18 @@ namespace client
 | 
			
		|||
				auto it = m_Addresses.find (name);
 | 
			
		||||
				if (it != m_Addresses.end ()) // already exists ?
 | 
			
		||||
				{
 | 
			
		||||
					if (it->second->IsIdentHash () && it->second->identHash != ident->GetIdentHash ()) // address changed?
 | 
			
		||||
					if (it->second->IsIdentHash () && it->second->identHash != ident->GetIdentHash () &&  // address changed?
 | 
			
		||||
						ident->GetSigningKeyType () != i2p::data::SIGNING_KEY_TYPE_DSA_SHA1) // don't replace by DSA 
 | 
			
		||||
					{
 | 
			
		||||
						it->second->identHash = ident->GetIdentHash ();
 | 
			
		||||
						m_Storage->AddAddress (ident);
 | 
			
		||||
						m_Storage->RemoveAddress (it->second->identHash);
 | 
			
		||||
						LogPrint (eLogInfo, "Addressbook: updated host: ", name);
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				else
 | 
			
		||||
				{
 | 
			
		||||
					//m_Addresses.emplace (name, std::make_shared<Address>(ident->GetIdentHash ()));
 | 
			
		||||
					m_Addresses[name] = std::make_shared<Address>(ident->GetIdentHash ()); // for gcc 4.7
 | 
			
		||||
					m_Addresses.emplace (name, std::make_shared<Address>(ident->GetIdentHash ()));
 | 
			
		||||
					m_Storage->AddAddress (ident);
 | 
			
		||||
					if (is_update)
 | 
			
		||||
						LogPrint (eLogInfo, "Addressbook: added new host: ", name);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue