mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-05 12:10:52 +02:00
delete the client peers from the exit nodes properly
This commit is contained in:
@@ -28,7 +28,7 @@ import {
|
||||
verifyExitNodeOrgAccess
|
||||
} from "#dynamic/lib/exitNodes";
|
||||
import { getUniqueSubnetForExitNode } from "@server/lib/exitNodes";
|
||||
import { addPeer } from "../gerbil/peers";
|
||||
import { addPeer, deletePeer } from "../gerbil/peers";
|
||||
|
||||
const HOLEPUNCH_STALE_CHAIN_THRESHOLD = 18;
|
||||
const HOLEPUNCH_STALE_CHAIN_TTL_SECONDS = 1800;
|
||||
@@ -394,6 +394,12 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => {
|
||||
);
|
||||
}
|
||||
|
||||
if (client.pubKey && client.pubKey !== publicKey && client.exitNodeId) {
|
||||
// test the old client to see if its different then remove
|
||||
logger.info("Public key mismatch. Deleting old peer...");
|
||||
await deletePeer(client.exitNodeId, client.pubKey);
|
||||
}
|
||||
|
||||
if (clientSubnet && exitNodeId) {
|
||||
try {
|
||||
// add the peer to the exit node so it can connect
|
||||
|
||||
Reference in New Issue
Block a user