} if ($network_mode == 2) { if (ipv6_test($peer_IP) == TRUE) { // IP Address is IPv6, ignore peer $duplicate_peer = TRUE; } else { if (empty($duplicate_check1) == TRUE && empty($duplicate_check2) == TRUE) { $duplicate_peer = FALSE; } else { $duplicate_peer = TRUE; } } } // IP v4 Only Peers Allowed if ($network_mode == 3) { if (ipv6_test($peer_IP) == TRUE) { if (empty($duplicate_check1) == TRUE && empty($duplicate_check2) == TRUE) { $duplicate_peer = FALSE; } else { $duplicate_peer = TRUE; } } else { // IP Address is IPv4, ignore peer $duplicate_peer = TRUE; } } // IP v6 Only Peers Allowed } else { $duplicate_peer = TRUE; } }
function find_v6_gen_key($my_public_key) { $sql = "SELECT IP_Address FROM `generating_peer_list` WHERE `public_key` = '{$my_public_key}'"; $sql_result = mysql_query($sql); $sql_num_results = mysql_num_rows($sql_result); for ($i = 0; $i < $sql_num_results; $i++) { $sql_row = mysql_fetch_array($sql_result); if (ipv6_test($sql_row["IP_Address"]) == TRUE) { //IPv6 Address Associated with this Generating Public Key return TRUE; } } // No Matching Keys with an IPv6 Address Found return; }
$sql_row = mysql_fetch_array($sql_result); if (ipv6_test($sql_row["IP_Address"]) == TRUE) { $ipv6_counter++; } else { $ipv4_counter++; } } $sql = "SELECT IP_Address FROM `generating_peer_queue`"; $sql_result = mysql_query($sql); $sql_num_results = mysql_num_rows($sql_result); $ipv4_counter_queue = 0; $ipv6_counter_queue = 0; // Count separate IPv4 & IPv6 Peers for ($i = 0; $i < $sql_num_results; $i++) { $sql_row = mysql_fetch_array($sql_result); if (ipv6_test($sql_row["IP_Address"]) == TRUE) { $ipv6_counter_queue++; } else { $ipv4_counter_queue++; } } $generate_currency_enabled = mysql_result(mysql_query("SELECT field_data FROM `options` WHERE `field_name` = 'generate_currency' LIMIT 1"), 0, 0); if ($generate_currency_enabled == "1") { $my_public_key = my_public_key(); $join_peer_list = mysql_result(mysql_query("SELECT join_peer_list FROM `generating_peer_list` WHERE `public_key` = '{$my_public_key}' LIMIT 1"), 0, 0); $last_generation = mysql_result(mysql_query("SELECT last_generation FROM `generating_peer_list` WHERE `public_key` = '{$my_public_key}' LIMIT 1"), 0, 0); $my_generation_IP = mysql_result(mysql_query("SELECT field_data FROM `options` WHERE `field_name` = 'generation_IP' LIMIT 1"), 0, 0); $my_generation_IP_v6 = mysql_result(mysql_query("SELECT field_data FROM `options` WHERE `field_name` = 'generation_IP_v6' LIMIT 1"), 0, 0); $network_mode = intval(mysql_result(mysql_query("SELECT field_data FROM `options` WHERE `field_name` = 'network_mode' LIMIT 1"), 0, 0)); if ($network_mode == 1) { // Both as Gateway Peer