src/net.cpp
// pushes our own address to a peer
pushes our own address to a peer
pushes our own address to a peer
void AdvertiseLocal(CNode *pnode)
{
    if (!fNoListen && pnode->fSuccessfullyConnected)
    {
        CAddress addrLocal = GetLocalAddress(&pnode->addr);
        if (IsPeerAddrLocalGood(pnode) && (!addrLocal.IsRoutable() ||
             GetRand((GetnScore(addrLocal) > LOCAL_MANUAL) ? 8:2) == 0))
        {
            addrLocal.SetIP(pnode->addrLocal);
        }
        if (addrLocal.IsRoutable())
        {
            printf("AdvertiseLocal: advertising address %s\n", addrLocal.ToString().c_str());
            pnode->PushAddress(addrLocal);
        }
    }
}
void AdvertiseLocal ( CNode * pnode ) { if ( ! fNoListen && pnode -> fSuccessfullyConnected ) { CAddress addrLocal = GetLocalAddress ( & pnode -> addr ) ; if ( IsPeerAddrLocalGood ( pnode ) && ( ! addrLocal . IsRoutable ( ) || GetRand ( ( GetnScore ( addrLocal ) > LOCAL_MANUAL ) ? 8 : 2 ) == 0 ) ) { addrLocal . SetIP ( pnode -> addrLocal ) ; } if ( addrLocal . IsRoutable ( ) ) { printf ( " \n " , addrLocal . ToString ( ) . c_str ( ) ) ; pnode -> PushAddress ( addrLocal ) ; } } }
pushes our own address to a peer
pushes our own address to a peer
// If discovery is enabled, sometimes give our peer the address it // tells us that it sees us as in case it has a better idea of our // address than we do.