mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-05-22 15:21:47 +02:00
use LocalLeaseSet for own LeaseSets
This commit is contained in:
parent
f2292fd618
commit
4e4f9b6f8b
8 changed files with 44 additions and 17 deletions
|
@ -192,7 +192,7 @@ namespace client
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<const i2p::data::LeaseSet> LeaseSetDestination::GetLeaseSet ()
|
||||
std::shared_ptr<const i2p::data::LocalLeaseSet> LeaseSetDestination::GetLeaseSet ()
|
||||
{
|
||||
if (!m_Pool) return nullptr;
|
||||
if (!m_LeaseSet)
|
||||
|
@ -202,7 +202,12 @@ namespace client
|
|||
|
||||
void LeaseSetDestination::UpdateLeaseSet ()
|
||||
{
|
||||
m_LeaseSet.reset (new i2p::data::LeaseSet (m_Pool));
|
||||
int numTunnels = m_Pool->GetNumInboundTunnels () + 2; // 2 backup tunnels
|
||||
if (numTunnels > i2p::data::MAX_NUM_LEASES) numTunnels = i2p::data::MAX_NUM_LEASES; // 16 tunnels maximum
|
||||
auto leaseSet = new i2p::data::LocalLeaseSet (GetIdentity (), GetEncryptionPublicKey (),
|
||||
m_Pool->GetInboundTunnels (numTunnels));
|
||||
Sign (leaseSet->GetBuffer (), leaseSet->GetBufferLen () - leaseSet->GetSignatureLen (), leaseSet->GetSignature ()); // TODO
|
||||
m_LeaseSet.reset (leaseSet);
|
||||
}
|
||||
|
||||
bool LeaseSetDestination::SubmitSessionKey (const uint8_t * key, const uint8_t * tag)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue