trac-peer 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/protocol.js +1 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trac-peer",
3
3
  "main": "src/index.js",
4
- "version": "0.2.0",
4
+ "version": "0.2.2",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "assert": "npm:bare-node-assert",
@@ -37,7 +37,7 @@
37
37
  "child_process": "npm:bare-node-child-process",
38
38
  "compact-encoding": "2.16.1",
39
39
  "console": "npm:bare-node-console",
40
- "corestore": "7.4.4",
40
+ "corestore": "7.4.2",
41
41
  "crypto": "npm:bare-node-crypto",
42
42
  "debounceify": "1.1.0",
43
43
  "events": "npm:bare-node-events",
@@ -47,7 +47,7 @@
47
47
  "http": "npm:bare-node-http",
48
48
  "https": "npm:bare-node-https",
49
49
  "hyperbee": "^2.24.2",
50
- "hypercore": "11.8.3",
50
+ "hypercore": "11.6.2",
51
51
  "hypercore-crypto": "^3.4.0",
52
52
  "hyperdht": "^6.20.5",
53
53
  "hyperswarm": "^4.11.5",
package/src/protocol.js CHANGED
@@ -84,8 +84,8 @@ class Protocol{
84
84
  const pk1 = this.peer.wallet.publicKey;
85
85
  const pk2 = await this.base.view.get('admin');
86
86
  if(null === pk2 || pk1 !== pk2.value) throw new Error('addFeature(key, feature): Features only allowed for admin.');
87
- if(typeof this.features[key] !== "undefined") throw new Error('addFeature(key, feature): Feature key exists already.');
88
87
  feature.key = key;
88
+ if(typeof this.features[key] !== "undefined") key = Math.random();
89
89
  this.features[key] = feature;
90
90
  }
91
91