check & optimize

This commit is contained in:
Mark Nadal 2018-03-14 10:16:18 -07:00
parent 402c56d14b
commit fa8a03c3ff
2 changed files with 7 additions and 6 deletions

11
gun.js
View File

@ -639,7 +639,7 @@
Type.obj.del(dup.s, id);
});
dup.to = null;
}, opt.age);
}, opt.age + 9);
}
return it;
}
@ -1812,7 +1812,8 @@
if(this.to){ this.to.next(msg) }
if((tmp = msg['@'])
&& (tmp = ctx.dup.s[tmp])
&& (tmp = tmp.it)){
&& (tmp = tmp.it)
&& tmp.mesh){
mesh.say(msg, tmp.mesh.via);
tmp['##'] = msg['##'];
return;
@ -1933,9 +1934,9 @@
msg['#'] = hash;
if(put){ (msg = Type.obj.to(msg)).put = _ }
}
msg['><'] = (Type.obj.map(ctx.opt.peers, function(p,k,m){
m(p.url || p.id);
}) || []).join();
var i = 0, to = []; Type.obj.map(ctx.opt.peers, function(p){
to.push[p.url || p.id]; if(++i > 9){ return true } // limit server, fast fix, improve later!
}); msg['><'] = to.join();
var raw = $(msg);
if(u !== put){
raw = raw.replace('"'+ _ +'"', put);

View File

@ -1,6 +1,6 @@
{
"name": "gun",
"version": "0.9.97",
"version": "0.9.98",
"description": "A realtime, decentralized, offline-first, graph data synchronization engine.",
"main": "index.js",
"browser": "gun.min.js",