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:
Thorsten Zoerner 2022-03-18 03:00:10 +01:00 committed by GitHub
parent f6b65c8e7e
commit 0e8b4549df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,7 @@ function start(root){
}
GET.turn = function(msg, route, turn){
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.
clearTimeout(tag.lack);
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 }
(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]}};
}());
}());