mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
Bind peer_hash to auth_key to avoid double announces via IPv4 and IPv6 at the same time (#1016)
This commit is contained in:
parent
a7566823c2
commit
1c7d45eabe
1 changed files with 2 additions and 2 deletions
|
@ -122,7 +122,7 @@ if (!\TorrentPier\Helpers\IPHelper::isValid($ip)) {
|
|||
$ip_sql = \TorrentPier\Helpers\IPHelper::ip2long($ip);
|
||||
|
||||
// Peer unique id
|
||||
$peer_hash = hash('xxh128', rtrim($info_hash, ' ') . $passkey . $ip . $port);
|
||||
$peer_hash = hash('xxh128', $passkey . $info_hash_hex);
|
||||
|
||||
// Events
|
||||
$stopped = ($event === 'stopped');
|
||||
|
@ -372,7 +372,7 @@ if (!$output) {
|
|||
");
|
||||
|
||||
if (empty($rowset)) {
|
||||
$rowset[] = ['ip' => \TorrentPier\Helpers\IPHelper::ip2long($ip), 'port' => (int)$port];
|
||||
$rowset[] = ['ip' => $ip_sql, 'port' => (int)$port];
|
||||
}
|
||||
|
||||
if ($compact_mode) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue