contract/test/libp2p/Common.cpp
bool p2p::isLocalHostAddress(bi::address const& _addressToCheck)
{
    // @todo: ivp6 link-local adresses (macos), ex: fe80::1%lo0
    static const set<bi::address> c_rejectAddresses = {
        {bi::address_v4::from_string("127.0.0.1")},
        {bi::address_v4::from_string("0.0.0.0")},
        {bi::address_v6::from_string("::1")},
        {bi::address_v6::from_string("::")}
    };
    
    return find(c_rejectAddresses.begin(), c_rejectAddresses.end(), _addressToCheck) != c_rejectAddresses.end();
}
// Helper function to determine if an address is localhost
Helper function to determine if an address is localhost
Helper function to determine if an address is localhost
bool p2p::isLocalHostAddress(bi::address const& _addressToCheck)
{
    static const set<bi::address> c_rejectAddresses = {
        {bi::address_v4::from_string("127.0.0.1")},
        {bi::address_v4::from_string("0.0.0.0")},
        {bi::address_v6::from_string("::1")},
        {bi::address_v6::from_string("::")}
    };
    return find(c_rejectAddresses.begin(), c_rejectAddresses.end(), _addressToCheck) != c_rejectAddresses.end();
}
bool p2p :: isLocalHostAddress ( bi :: address const & _addressToCheck ) { static const set < bi :: address > c_rejectAddresses = { { bi :: address_v4 :: from_string ( " " ) } , { bi :: address_v4 :: from_string ( " " ) } , { bi :: address_v6 :: from_string ( " " ) } , { bi :: address_v6 :: from_string ( " " ) } } ; return find ( c_rejectAddresses . begin ( ) , c_rejectAddresses . end ( ) , _addressToCheck ) != c_rejectAddresses . end ( ) ; }
Helper function to determine if an address is localhost
Helper function to determine if an address is localhost
// @todo: ivp6 link-local adresses (macos), ex: fe80::1%lo0