| 758 | } |
| 759 | |
| 760 | bool LeaseSetDestination::RequestDestinationWithEncryptedLeaseSet (std::shared_ptr<const i2p::data::BlindedPublicKey> dest, RequestComplete requestComplete) |
| 761 | { |
| 762 | if (!dest || !m_Pool || !IsReady ()) |
| 763 | { |
| 764 | if (requestComplete) |
| 765 | boost::asio::post (m_Service, [requestComplete](void){requestComplete (nullptr);}); |
| 766 | return false; |
| 767 | } |
| 768 | auto storeHash = dest->GetStoreHash (); |
| 769 | auto leaseSet = FindLeaseSet (storeHash); |
| 770 | if (leaseSet) |
| 771 | { |
| 772 | if (requestComplete) |
| 773 | boost::asio::post (m_Service, [requestComplete, leaseSet](void){requestComplete (leaseSet);}); |
| 774 | return true; |
| 775 | } |
| 776 | boost::asio::post (m_Service, std::bind (&LeaseSetDestination::RequestLeaseSet, shared_from_this (), storeHash, requestComplete, dest)); |
| 777 | return true; |
| 778 | } |
| 779 | |
| 780 | void LeaseSetDestination::CancelDestinationRequest (const i2p::data::IdentHash& dest, bool notify) |
| 781 | { |
no test coverage detected