@leofcoin/peernet 0.10.2 → 0.10.3

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.
@@ -289,7 +289,7 @@ class LeofcoinStorage$1 {
289
289
 
290
290
  }
291
291
 
292
- var version = "0.10.1";
292
+ var version = "0.10.2";
293
293
 
294
294
  var api$1 = {
295
295
  version: ({send}) => send({client: '@peernet/api/http', version}),
@@ -2018,7 +2018,7 @@ class Peernet {
2018
2018
  globalThis.peernet = this;
2019
2019
  this.bw = {
2020
2020
  up: 0,
2021
- down: 0
2021
+ down: 0,
2022
2022
  };
2023
2023
  return this._init(options)
2024
2024
  }
@@ -2232,7 +2232,7 @@ class Peernet {
2232
2232
  */
2233
2233
  async _protoHandler(message, peer) {
2234
2234
  const {id, proto} = message;
2235
- this.bw.down += message.encoded.length;
2235
+ this.bw.down += proto.encoded.length;
2236
2236
  if (proto.name === 'peernet-peer') {
2237
2237
  const from = proto.decoded.id;
2238
2238
  if (!this.peerMap.has(from)) this.peerMap.set(from, [peer.id]);
@@ -292,7 +292,7 @@ class LeofcoinStorage$1 {
292
292
 
293
293
  }
294
294
 
295
- var version = "0.10.1";
295
+ var version = "0.10.2";
296
296
 
297
297
  var api$1 = {
298
298
  version: ({send}) => send({client: '@peernet/api/http', version}),
@@ -1453,7 +1453,7 @@ class Peernet {
1453
1453
  globalThis.peernet = this;
1454
1454
  this.bw = {
1455
1455
  up: 0,
1456
- down: 0
1456
+ down: 0,
1457
1457
  };
1458
1458
  return this._init(options)
1459
1459
  }
@@ -1667,7 +1667,7 @@ class Peernet {
1667
1667
  */
1668
1668
  async _protoHandler(message, peer) {
1669
1669
  const {id, proto} = message;
1670
- this.bw.down += message.encoded.length;
1670
+ this.bw.down += proto.encoded.length;
1671
1671
  if (proto.name === 'peernet-peer') {
1672
1672
  const from = proto.decoded.id;
1673
1673
  if (!this.peerMap.has(from)) this.peerMap.set(from, [peer.id]);
@@ -272,7 +272,7 @@ class LeofcoinStorage$1 {
272
272
 
273
273
  }
274
274
 
275
- var version = "0.10.1";
275
+ var version = "0.10.2";
276
276
 
277
277
  var api$1 = {
278
278
  version: ({send}) => send({client: '@peernet/api/http', version}),
@@ -2215,7 +2215,7 @@ class Peernet {
2215
2215
  */
2216
2216
  async _protoHandler(message, peer) {
2217
2217
  const {id, proto} = message;
2218
- this.bw.down += message.encoded.length;
2218
+ this.bw.down += proto.encoded.length;
2219
2219
  if (proto.name === 'peernet-peer') {
2220
2220
  const from = proto.decoded.id;
2221
2221
  if (!this.peerMap.has(from)) this.peerMap.set(from, [peer.id]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/peernet",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "description": "",
5
5
  "main": "dist/commonjs/peernet.js",
6
6
  "module": "dist/module/peernet.js",
package/src/peernet.js CHANGED
@@ -278,7 +278,7 @@ export default class Peernet {
278
278
  */
279
279
  async _protoHandler(message, peer) {
280
280
  const {id, proto} = message
281
- this.bw.down += message.encoded.length
281
+ this.bw.down += proto.encoded.length
282
282
  if (proto.name === 'peernet-peer') {
283
283
  const from = proto.decoded.id
284
284
  if (!this.peerMap.has(from)) this.peerMap.set(from, [peer.id])