wire-mesh-core 4.0.4 → 4.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -494,7 +494,10 @@ function createSessionCore(identity, clock, reconnect, dial, onPeerAdvert, addre
|
|
|
494
494
|
else if (frame.type === "gossip") {
|
|
495
495
|
const verdicts = await Promise.all(frame.peers.map(async (advert) => require_domain_peer_advert.verifyPeerAdvert(identity, advert)));
|
|
496
496
|
for (const advert of frame.peers.filter((_, i) => verdicts[i] === true)) {
|
|
497
|
-
|
|
497
|
+
const deviceHex = require_domain_device_id.deviceIdToHex(advert.device);
|
|
498
|
+
const held = directory.get(deviceHex)?.advert["snapshot-seconds"];
|
|
499
|
+
if (held !== void 0 && advert["snapshot-seconds"] < held) continue;
|
|
500
|
+
directory.set(deviceHex, {
|
|
498
501
|
device: advert.device,
|
|
499
502
|
advert
|
|
500
503
|
});
|
|
@@ -493,7 +493,10 @@ function createSessionCore(identity, clock, reconnect, dial, onPeerAdvert, addre
|
|
|
493
493
|
else if (frame.type === "gossip") {
|
|
494
494
|
const verdicts = await Promise.all(frame.peers.map(async (advert) => verifyPeerAdvert(identity, advert)));
|
|
495
495
|
for (const advert of frame.peers.filter((_, i) => verdicts[i] === true)) {
|
|
496
|
-
|
|
496
|
+
const deviceHex = deviceIdToHex(advert.device);
|
|
497
|
+
const held = directory.get(deviceHex)?.advert["snapshot-seconds"];
|
|
498
|
+
if (held !== void 0 && advert["snapshot-seconds"] < held) continue;
|
|
499
|
+
directory.set(deviceHex, {
|
|
497
500
|
device: advert.device,
|
|
498
501
|
advert
|
|
499
502
|
});
|
package/package.json
CHANGED
|
Binary file
|