本文整理汇总了C++中CAddrInfo::GetI2pDestination方法的典型用法代码示例。如果您正苦于以下问题:C++ CAddrInfo::GetI2pDestination方法的具体用法?C++ CAddrInfo::GetI2pDestination怎么用?C++ CAddrInfo::GetI2pDestination使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAddrInfo
的用法示例。
在下文中一共展示了CAddrInfo::GetI2pDestination方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CopyDestinationStats
// Returns the number of entries processed
int CAddrMan::CopyDestinationStats( std::vector<CDestinationStats>& vStats )
{
int nSize = 0;
vStats.clear();
vStats.reserve( mapI2pHashes.size() );
for( std::map<uint256, int>::iterator it = mapI2pHashes.begin(); it != mapI2pHashes.end(); it++) {
CDestinationStats stats;
std::map<int, CAddrInfo>::iterator it2 = mapInfo.find((*it).second);
if (it2 != mapInfo.end()) {
CAddrInfo* paddr = &(*it2).second;
stats.sAddress = paddr->ToString();
stats.fInTried = paddr->fInTried;
stats.uPort = paddr->GetPort();
stats.nServices = paddr->nServices;
stats.nAttempts = paddr->nAttempts;
stats.nLastTry = paddr->nLastTry;
stats.nSuccessTime = paddr->nLastSuccess;
stats.sSource = paddr->source.ToString();
stats.sBase64 = paddr->GetI2pDestination();
nSize++;
vStats.push_back( stats );
}
}
assert( mapI2pHashes.size() == nSize );
return nSize;
}
示例2: LogPrint
void CAddrMan::CheckAndDeleteB32Hash( const int nID, const CAddrInfo& aTerrible )
{
if( aTerrible.IsI2P() ) {
uint256 b32hash = GetI2pDestinationHash( aTerrible.GetI2pDestination() );
if( mapI2pHashes.count( b32hash ) == 1 ) {
int nID2 = mapI2pHashes[ b32hash ];
if( nID == nID2 ) // Yap this is the one they want to delete, and it exists
mapI2pHashes.erase( b32hash );
else {
LogPrint( "addrman", "While attempting to erase base32 hash %s, it was unexpected that the ids differ id1=%d != id2=%d\n", b32hash.GetHex(), nID, nID2 );
// CAddrInfo& info2 = mapInfo[nID2];
// aTerrible.print();
// info2.print();
}
}
else {
LogPrint( "addrman", "While attempting to remove base32 hash %s, it was found to not exist.\n", b32hash.GetHex() );
// aTerrible.print();
}
}
}
示例3: CAddrInfo
/** \brief Simply looks up the hash, if the id is found returns a pointer to the
CAddrInfo(CAddress(CService(CNetAddr()))) class object where the base64 string is stored
*
* \param sB32addr const string&
* \return string, null if not found or the Base64 destination string of give b32.i2p address
*
*/
std::string CAddrMan::GetI2pBase64Destination(const std::string& sB32addr)
{
CAddrInfo* paddr = LookupB32addr(sB32addr);
return paddr && paddr->IsI2P() ? paddr->GetI2pDestination() : std::string();
}