当前位置: 首页>>代码示例>>C++>>正文


C++ CAddrInfo::GetI2pDestination方法代码示例

本文整理汇总了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;
}
开发者ID:sorceressofmathematics,项目名称:anoncoin,代码行数:27,代码来源:addrman.cpp

示例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();
        }
    }
}
开发者ID:sorceressofmathematics,项目名称:anoncoin,代码行数:21,代码来源:addrman.cpp

示例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();
}
开发者ID:sorceressofmathematics,项目名称:anoncoin,代码行数:12,代码来源:addrman.cpp


注:本文中的CAddrInfo::GetI2pDestination方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。