mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
shared_ptr for local destination in TunnelPool
This commit is contained in:
parent
8ad20c0db3
commit
4599f6919c
8 changed files with 30 additions and 18 deletions
|
@ -21,11 +21,12 @@ namespace data
|
|||
ReadFromBuffer ();
|
||||
}
|
||||
|
||||
LeaseSet::LeaseSet (const i2p::tunnel::TunnelPool& pool):
|
||||
LeaseSet::LeaseSet (std::shared_ptr<const i2p::tunnel::TunnelPool> pool):
|
||||
m_IsValid (true)
|
||||
{
|
||||
if (!pool) return;
|
||||
// header
|
||||
const i2p::data::LocalDestination * localDestination = pool.GetLocalDestination ();
|
||||
auto localDestination = pool->GetLocalDestination ();
|
||||
if (!localDestination)
|
||||
{
|
||||
m_Buffer = nullptr;
|
||||
|
@ -41,7 +42,7 @@ namespace data
|
|||
auto signingKeyLen = localDestination->GetIdentity ()->GetSigningPublicKeyLen ();
|
||||
memset (m_Buffer + m_BufferLen, 0, signingKeyLen);
|
||||
m_BufferLen += signingKeyLen;
|
||||
auto tunnels = pool.GetInboundTunnels (5); // 5 tunnels maximum
|
||||
auto tunnels = pool->GetInboundTunnels (5); // 5 tunnels maximum
|
||||
m_Buffer[m_BufferLen] = tunnels.size (); // num leases
|
||||
m_BufferLen++;
|
||||
// leases
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue