Skip to content

Commit

Permalink
Remove ClientContext.h dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
klondi committed Jan 7, 2015
1 parent 75f6cc4 commit c1a29b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion AddressBook.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ namespace client
const int CONTINIOUS_SUBSCRIPTION_UPDATE_TIMEOUT = 240; // in minutes
const int CONTINIOUS_SUBSCRIPTION_RETRY_TIMEOUT = 5; // in minutes
const int SUBSCRIPTION_REQUEST_TIMEOUT = 60; //in second

inline std::string GetB32Address(const i2p::data::IdentHash& ident) { return ident.ToBase32().append(".b32.i2p"); }

class AddressBookStorage // interface for storage
{
Expand Down Expand Up @@ -55,7 +57,7 @@ namespace client
void LoadHostsFromStream (std::istream& f);
void DownloadComplete (bool success);
//This method returns the ".b32.i2p" address
std::string ToAddress(const i2p::data::IdentHash& ident) { return ident.ToBase32().append(".b32.i2p"); }
std::string ToAddress(const i2p::data::IdentHash& ident) { return GetB32Address(ident); }
std::string ToAddress(const i2p::data::IdentityEx& ident) { return ToAddress(ident.GetIdentHash ()); }
private:

Expand Down
4 changes: 2 additions & 2 deletions Destination.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "ElGamal.h"
#include "Timestamp.h"
#include "NetDb.h"
#include "ClientContext.h"
#include "AddressBook.h"
#include "Destination.h"

namespace i2p
Expand Down Expand Up @@ -47,7 +47,7 @@ namespace client
}
m_Pool = i2p::tunnel::tunnels.CreateTunnelPool (this, inboundTunnelLen, outboundTunnelLen);
if (m_IsPublic)
LogPrint (eLogInfo, "Local address ", i2p::client::context.GetAddressBook ().ToAddress(GetIdentHash()), " created");
LogPrint (eLogInfo, "Local address ", i2p::client::GetB32Address(GetIdentHash()), " created");
m_StreamingDestination = new i2p::stream::StreamingDestination (*this); // TODO:
}

Expand Down

0 comments on commit c1a29b0

Please sign in to comment.