1ac87c7e by Jabis Sevón

gunshit

1 parent 3306413d
......@@ -1413,7 +1413,7 @@
if(cat.jam){ return cat.jam.push([cb, as]) }
cat.jam = [[cb,as]];
gun.get(function go(msg, eve){
if(u === msg.put && (tmp = Object.keys(cat.root.opt.peers).length) && ++acks <= tmp){
if(u === msg.put && !cat.root.opt.super && (tmp = Object.keys(cat.root.opt.peers).length) && ++acks <= tmp){
return;
}
eve.rid(msg);
......@@ -1811,7 +1811,7 @@
}
if((tmp = eve.wait) && (tmp = tmp[at.id])){ clearTimeout(tmp) }
eve.ack = (eve.ack||0)+1;
if(!to && u === data && eve.ack <= (opt.acks || Object.keys(at.root.opt.peers).length)){ return }
if(!to && u === data && !at.root.opt.super && eve.ack <= (opt.acks || Object.keys(at.root.opt.peers).length)){ return }
if((!to && (u === data || at.soul || at.link || (link && !(0 < link.ack))))
|| (u === data && (tmp = Object.keys(at.root.opt.peers).length) && (!to && (link||at).ack < tmp))){
tmp = (eve.wait = {})[at.id] = setTimeout(function(){
......@@ -1819,7 +1819,7 @@
}, opt.wait || 99);
return;
}
if(link && u === link.put && (tmp = rel.is(data))){ data = Gun.node.ify({}, tmp) }
if(link && u === link.put && !at.root.opt.super && (tmp = rel.is(data))){ data = Gun.node.ify({}, tmp) }
eve.rid? eve.rid(msg) : eve.off();
opt.ok.call(gun || opt.$, data, msg.get);
}
......@@ -2062,7 +2062,7 @@
Gun.log(err = (e || "localStorage failure") + " Consider using GUN's IndexedDB plugin for RAD for more storage space, https://gun.eco/docs/RAD#install");
root.on('localStorage:error', {err: err, file: opt.prefix, flush: disk, retry: flush});
}
//if(!err && !Gun.obj.empty(opt.peers)){ return } // only ack if there are no peers.
if(!err && !Gun.obj.empty(opt.peers)){ return } // only ack if there are no peers.
Gun.obj.map(ack, function(yes, id){
if(yes){
if(yes.more){ acks[id] = yes; return }
......
function Nomem(){
var opt = {}, u;
opt.put = function(file, data, cb){ cb(null, -9) }; // dev/null!
opt.get = function(file, cb){ cb(null,-9) };
opt.get = function(file, cb){ cb(null) };
return opt;
}
if(typeof window !== "undefined"){
window.Nomem = Nomem;
} else {
try{ module.exports = Nomem }catch(e){}
}
}
\ No newline at end of file
......
......@@ -6,11 +6,11 @@
const no = require('gun/lib/nomem')(); // no-memory storage adapter for RAD
const fs = require("fs");
const url = require("url");
const Gun = require("gun"); // load defaults
const Gun = require("../multigungun/gun"); // load defaults
//require("./gun-ws.js"); // required to allow external websockets into gun constructor
//require("./mem.js"); // disable to allow file writing for debug
require("gun/sea");
require("gun/lib/then");
//require("gun/sea");
//require("gun/lib/then");
const SEA = Gun.SEA;
const http = require("http");
const https = require("https");
......@@ -79,7 +79,7 @@ server.on("upgrade", async function(request, socket, head) {
let peers = []; // relaypeers.split(',').map(function(p){ return p+relaypath; });
if(debug) console.log("peers",peers);
let g = gun.gun = Gun({
axe:false,
//axe:false,
peers: peers, // should we use self as peer?
localStorage: false,
store: no,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!