5
0
mirror of https://github.com/cwinfo/hyperboria-peers.git synced 2024-11-21 21:50:28 +00:00

serialize pub location along with peering data

This commit is contained in:
ansuz 2017-03-11 15:49:12 +01:00
parent 9084e82644
commit a0f73582b4

View File

@ -43,7 +43,9 @@ var Fs = require("fs"),
find(peers, A.slice(1))[name] = {}; find(peers, A.slice(1))[name] = {};
walk(A.concat(name)); walk(A.concat(name));
} else if (/\.k$/.test(name)) { } else if (/\.k$/.test(name)) {
find(peers, A.slice(1))[name] = read(fullPath); var obj = find(peers, A.slice(1))[name] = read(fullPath);
// embed the location in the object
obj.location = A.slice(1);
} }
}); });
}; };
@ -69,7 +71,6 @@ var Fs = require("fs"),
var path = p.slice(0).concat(k); var path = p.slice(0).concat(k);
if (isCred(k)) { if (isCred(k)) {
//console.log(o[k]);
L.push(f(o[k], path)); L.push(f(o[k], path));
} }
walk(o[k], path, f); walk(o[k], path, f);