mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Testing passing.
`npm run testaxe` Dont repeat rtc.nnounce.
This commit is contained in:
parent
ed509d0ae3
commit
d3f0d326b2
3
axe.js
3
axe.js
@ -181,7 +181,8 @@
|
||||
dht(soul, pids);
|
||||
Gun.obj.map(pids.split(','), function(pid) {
|
||||
/// TODO: here we can put an algorithm of who must connect?
|
||||
if (!pid || pid in opt.peers || pid === opt.pid) { return; }
|
||||
if (!pid || pid in opt.peers || pid === opt.pid || opt.announce[pid]) { return; }
|
||||
opt.announce[pid] = true; /// To try only one connection to the same peer.
|
||||
opt.announce(pid);
|
||||
});
|
||||
});
|
||||
|
@ -49,6 +49,7 @@
|
||||
function open(msg){
|
||||
var rtc = msg.rtc, peer, tmp;
|
||||
if(!rtc || !rtc.id){ return }
|
||||
delete opt.announce[rtc.id]; /// remove after connect
|
||||
if(tmp = rtc.answer){
|
||||
if(!(peer = opt.peers[rtc.id]) || peer.remoteSet){ return }
|
||||
return peer.setRemoteDescription(peer.remoteSet = new opt.RTCSessionDescription(tmp));
|
||||
|
Loading…
x
Reference in New Issue
Block a user