This commit is contained in:
Mark Nadal 2022-08-03 16:33:16 -07:00
parent ef59ea185c
commit e840df43af
2 changed files with 7 additions and 2 deletions

2
axe.js
View File

@ -40,7 +40,7 @@
(function next(){
if(!axe.fall){ setTimeout(next, 9); return } // not found yet
var fall = Object.keys(axe.fall||''), one = fall[(Math.random()*fall.length) >> 0];
if(!fall.length){ lS.peers = ''; return } // out of peers
if(!fall.length){ lS.peers = ''; one = 'https://gunjs.herokuapp.com/gun' } // out of peers
if(peers[one]){ next(); return } // already choose
mesh.hi(one);
}());

7
gun.js
View File

@ -384,8 +384,13 @@
var DBG; if(DBG = (msg._||'').DBG){ DBG.pa = +new Date; DBG.pm = DBG.pm || +new Date}
var eve = this, root = eve.as, graph = root.graph, ctx = msg._, put = msg.put, soul = put['#'], key = put['.'], val = put[':'], state = put['>'], id = msg['#'], tmp;
if((tmp = ctx.msg) && (tmp = tmp.put) && (tmp = tmp[soul])){ state_ify(tmp, key, state, val, soul) } // necessary! or else out messages do not get SEA transforms.
//var bytes = ((graph[soul]||'')[key]||'').length||1;
graph[soul] = state_ify(graph[soul], key, state, val, soul);
if(tmp = (root.next||'')[soul]){ tmp.on('in', msg) }
if(tmp = (root.next||'')[soul]){
//tmp.bytes = (tmp.bytes||0) + ((val||'').length||1) - bytes;
//if(tmp.bytes > 2**13){ Gun.log.once('byte-limit', "Note: In the future, GUN peers will enforce a ~4KB query limit. Please see https://gun.eco/docs/Page") }
tmp.on('in', msg)
}
fire(ctx);
eve.to.next(msg);
}