mirror of
https://github.com/amark/gun.git
synced 2025-11-27 15:54:04 +00:00
Update axe.js (#1222)
Should solve uncaught exception:
```
error] TypeError: Cannot read properties of undefined (reading 'lack')
at Function.GET.turn (/root/.node-red/node_modules/gun/lib/axe.js:42:20)
at Timeout._onTimeout (/root/.node-red/node_modules/gun/lib/axe.js:57:42)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
```
That happens in some node environments from time to time.
This commit is contained in:
parent
f6b65c8e7e
commit
0e8b4549df
@ -37,7 +37,7 @@ function start(root){
|
|||||||
}
|
}
|
||||||
GET.turn = function(msg, route, turn){
|
GET.turn = function(msg, route, turn){
|
||||||
var tmp = msg['#'], tag = dup.s[tmp], next;
|
var tmp = msg['#'], tag = dup.s[tmp], next;
|
||||||
if(!tmp){ return }
|
if((!tmp)||(!tag)) { return }
|
||||||
// Ideas: Save a random seed that sorts the route, store it and the index. // Or indexing on lowest latency is probably better.
|
// Ideas: Save a random seed that sorts the route, store it and the index. // Or indexing on lowest latency is probably better.
|
||||||
clearTimeout(tag.lack);
|
clearTimeout(tag.lack);
|
||||||
if(tag.ack && (tmp = tag['##']) && msg['##'] === tmp){ return } // hashes match, stop asking other peers!
|
if(tag.ack && (tmp = tag['##']) && msg['##'] === tmp){ return } // hashes match, stop asking other peers!
|
||||||
@ -159,4 +159,4 @@ function start(root){
|
|||||||
}
|
}
|
||||||
if(from){ return Object.Map = Map }
|
if(from){ return Object.Map = Map }
|
||||||
(Object.Map = function(){ this.s = {} }).prototype = {set:function(k,v){this.s[k]=v;return this},get:function(k){return this.s[k]},delete:function(k){delete this.s[k]}};
|
(Object.Map = function(){ this.s = {} }).prototype = {set:function(k,v){this.s[k]=v;return this},get:function(k){return this.s[k]},delete:function(k){delete this.s[k]}};
|
||||||
}());
|
}());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user