From e840df43af766cc4714b89ac63726a953c2962f4 Mon Sep 17 00:00:00 2001 From: Mark Nadal Date: Wed, 3 Aug 2022 16:33:16 -0700 Subject: [PATCH] note/fix --- axe.js | 2 +- gun.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/axe.js b/axe.js index 34f77925..d8275294 100644 --- a/axe.js +++ b/axe.js @@ -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); }()); diff --git a/gun.js b/gun.js index 92e506c5..7fdd5e12 100644 --- a/gun.js +++ b/gun.js @@ -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); }