mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Merge pull request #810 from GoodDollar/SEA-concurrent-possible-fix
SEA concurrent possible fix
This commit is contained in:
commit
8a44eb7f62
@ -19,7 +19,6 @@ Gun.on('opt', function(root){
|
||||
os.loadavg = os.loadavg || noop;
|
||||
os.cpus = os.cpus || noop;
|
||||
setTimeout(function(){
|
||||
root.opt.file += (process.argv[2]||'');
|
||||
root.stats = Gun.obj.ify((fs.existsSync(__dirname+'/../stats.'+root.opt.file) && fs.readFileSync(__dirname+'/../stats.'+root.opt.file).toString())) || {};
|
||||
root.stats.up = root.stats.up || {};
|
||||
root.stats.up.start = root.stats.up.start || +(new Date);
|
||||
@ -56,4 +55,4 @@ Gun.on('opt', function(root){
|
||||
stats.gap = {};
|
||||
}, 1000 * 15);
|
||||
Object.keys = Object.keys || function(o){ return Gun.obj.map(o, function(v,k,t){t(k)}) }
|
||||
});
|
||||
});
|
||||
|
@ -13,7 +13,7 @@
|
||||
var epriv = pair.epriv;
|
||||
var ecdhSubtle = shim.ossl || shim.subtle;
|
||||
var pubKeyData = keysToEcdhJwk(pub);
|
||||
var props = Object.assign(S.ecdh, { public: await ecdhSubtle.importKey(...pubKeyData, true, []) });
|
||||
var props = Object.assign({ public: await ecdhSubtle.importKey(...pubKeyData, true, []) },S.ecdh);
|
||||
var privKeyData = keysToEcdhJwk(epub, epriv);
|
||||
var derived = await ecdhSubtle.importKey(...privKeyData, false, ['deriveKey']).then(async (privKey) => {
|
||||
// privateKey scope doesn't leak out from here!
|
||||
@ -47,4 +47,4 @@
|
||||
}
|
||||
|
||||
module.exports = SEA.secret;
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user