| 42 | } |
| 43 | |
| 44 | std::shared_ptr<GarlicRoutingPath> GarlicRoutingSession::GetSharedRoutingPath () |
| 45 | { |
| 46 | if (!m_SharedRoutingPath) return nullptr; |
| 47 | uint32_t ts = i2p::util::GetSecondsSinceEpoch (); |
| 48 | if (!m_SharedRoutingPath->outboundTunnel->IsEstablished () || |
| 49 | ts*1000LL > m_SharedRoutingPath->remoteLease->endDate || |
| 50 | ts > m_SharedRoutingPath->updateTime + ROUTING_PATH_EXPIRATION_TIMEOUT) |
| 51 | m_SharedRoutingPath = nullptr; |
| 52 | return m_SharedRoutingPath; |
| 53 | } |
| 54 | |
| 55 | void GarlicRoutingSession::SetSharedRoutingPath (std::shared_ptr<GarlicRoutingPath> path) |
| 56 | { |
no test coverage detected