@leofcoin/chain 1.4.69 → 1.4.71

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.
@@ -1,4 +1,4 @@
1
- import { B as BigNumber, L as Logger, v as version$1, h as hexZeroPad, i as isBigNumberish, a as arrayify, b as isBytes, C as ContractMessage, T as TransactionMessage, R as RawTransactionMessage, c as BlockMessage, d as BWMessage, e as BWRequestMessage } from './index-640d9f36.js';
1
+ import { B as BigNumber, L as Logger, v as version$1, h as hexZeroPad, i as isBigNumberish, a as arrayify, b as isBytes, C as ContractMessage, T as TransactionMessage, R as RawTransactionMessage, c as BlockMessage, d as BWMessage, e as BWRequestMessage } from './index-2d1bd076.js';
2
2
 
3
3
  const logger$1 = new Logger(version$1);
4
4
  const _constructorGuard = {};
@@ -8268,11 +8268,10 @@ class Chain extends Contract {
8268
8268
  return;
8269
8269
  const lastBlock = await this.#makeRequest(peer, 'lastBlock');
8270
8270
  if (Object.keys(lastBlock).length > 0) {
8271
- if (this.#resolveErrored || lastBlock && lastBlock.index > this.#lastBlock?.index) {
8271
+ if (this.#resolveErrored || !this.#lastBlock || lastBlock && lastBlock.index > this.#lastBlock?.index) {
8272
8272
  // this.#knownBlocks = await this.#makeRequest(peer, 'knownBlocks')
8273
8273
  this.#resolveErrored = false;
8274
- if (lastBlock)
8275
- await this.syncChain(lastBlock);
8274
+ await this.syncChain(lastBlock);
8276
8275
  if (await this.hasTransactionToHandle() && !this.#resolveErrored && this.#participating)
8277
8276
  this.#runEpoch();
8278
8277
  }
@@ -10605,13 +10605,17 @@ let P2PT$1 = class P2PT extends require$$0$5 {
10605
10605
  */
10606
10606
  start() {
10607
10607
  this.on('peer', peer => {
10608
- let newpeer = false;
10609
- if (!this.peers[peer.id]) {
10610
- newpeer = true;
10611
- this.peers[peer.id] = {};
10612
- this.responseWaiting[peer.id] = {};
10613
- }
10614
10608
  peer.on('connect', () => {
10609
+ let newpeer = false;
10610
+ /**
10611
+ * peer connected or reconnected
10612
+ * Sometimes peers reconnect so need to handle the newpeer here
10613
+ */
10614
+ if (!this.peers[peer.id]) {
10615
+ newpeer = true;
10616
+ this.peers[peer.id] = {};
10617
+ this.responseWaiting[peer.id] = {};
10618
+ }
10615
10619
  /**
10616
10620
  * Multiple data channels to one peer is possible
10617
10621
  * The `peer` object actually refers to a peer with a data channel. Even though it may have same `id` (peerID) property, the data channel will be different. Different trackers giving the same "peer" will give the `peer` object with different channels.
@@ -1,5 +1,9 @@
1
1
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
2
 
3
+ function getDefaultExportFromCjs (x) {
4
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5
+ }
6
+
3
7
  function getAugmentedNamespace(n) {
4
8
  if (n.__esModule) return n;
5
9
  var f = n.default;
@@ -28,11 +32,7 @@ function getAugmentedNamespace(n) {
28
32
  return a;
29
33
  }
30
34
 
31
- var bnExports = {};
32
- var bn = {
33
- get exports(){ return bnExports; },
34
- set exports(v){ bnExports = v; },
35
- };
35
+ var bn = {exports: {}};
36
36
 
37
37
  var _nodeResolve_empty = {};
38
38
 
@@ -3391,10 +3391,11 @@ var require$$0 = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1);
3391
3391
  var res = this.imod(a._invmp(this.m).mul(this.r2));
3392
3392
  return res._forceRed(this);
3393
3393
  };
3394
- })(module, commonjsGlobal);
3394
+ })(module, commonjsGlobal);
3395
3395
  } (bn));
3396
3396
 
3397
- var _BN = bnExports;
3397
+ var bnExports = bn.exports;
3398
+ var _BN = /*@__PURE__*/getDefaultExportFromCjs(bnExports);
3398
3399
 
3399
3400
  const version$2 = "logger/5.7.0";
3400
3401
 
@@ -1,5 +1,5 @@
1
- import { M as MultiWallet, e as encrypt, b as base58$1 } from './node-browser-e61b575b.js';
2
- import './index-640d9f36.js';
1
+ import { M as MultiWallet, e as encrypt, b as base58$1 } from './node-browser-1585d228.js';
2
+ import './index-2d1bd076.js';
3
3
 
4
4
  /**
5
5
  * @params {String} network
@@ -1,5 +1,5 @@
1
- import { F as FormatInterface } from './node-browser-e61b575b.js';
2
- import './index-640d9f36.js';
1
+ import { F as FormatInterface } from './node-browser-1585d228.js';
2
+ import './index-2d1bd076.js';
3
3
 
4
4
  var proto$b = {
5
5
  data: new Uint8Array(),
@@ -1,4 +1,4 @@
1
- import { C as ContractMessage, T as TransactionMessage, c as BlockMessage, d as BWMessage, e as BWRequestMessage, V as ValidatorMessage } from './index-640d9f36.js';
1
+ import { C as ContractMessage, T as TransactionMessage, c as BlockMessage, d as BWMessage, e as BWRequestMessage, V as ValidatorMessage } from './index-2d1bd076.js';
2
2
 
3
3
  var nodeConfig = async (config = {
4
4
  network: 'leofcoin:peach',
@@ -731,6 +731,10 @@ var index$2 = {
731
731
 
732
732
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
733
733
 
734
+ function getDefaultExportFromCjs (x) {
735
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
736
+ }
737
+
734
738
  function getAugmentedNamespace(n) {
735
739
  if (n.__esModule) return n;
736
740
  var f = n.default;
@@ -759,11 +763,7 @@ function getAugmentedNamespace(n) {
759
763
  return a;
760
764
  }
761
765
 
762
- var bnExports$1 = {};
763
- var bn$1 = {
764
- get exports(){ return bnExports$1; },
765
- set exports(v){ bnExports$1 = v; },
766
- };
766
+ var bn$1 = {exports: {}};
767
767
 
768
768
  var _nodeResolve_empty = {};
769
769
 
@@ -4122,10 +4122,11 @@ var require$$0$1 = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1);
4122
4122
  var res = this.imod(a._invmp(this.m).mul(this.r2));
4123
4123
  return res._forceRed(this);
4124
4124
  };
4125
- })(module, commonjsGlobal);
4125
+ })(module, commonjsGlobal);
4126
4126
  } (bn$1));
4127
4127
 
4128
- var _BN = bnExports$1;
4128
+ var bnExports$1 = bn$1.exports;
4129
+ var _BN = /*@__PURE__*/getDefaultExportFromCjs(bnExports$1);
4129
4130
 
4130
4131
  const version$4 = "logger/5.7.0";
4131
4132
 
@@ -7229,11 +7230,7 @@ var require$$0 = {
7229
7230
 
7230
7231
  var utils$o = {};
7231
7232
 
7232
- var bnExports = {};
7233
- var bn = {
7234
- get exports(){ return bnExports; },
7235
- set exports(v){ bnExports = v; },
7236
- };
7233
+ var bn = {exports: {}};
7237
7234
 
7238
7235
  (function (module) {
7239
7236
  (function (module, exports) {
@@ -10678,9 +10675,11 @@ var bn = {
10678
10675
  var res = this.imod(a._invmp(this.m).mul(this.r2));
10679
10676
  return res._forceRed(this);
10680
10677
  };
10681
- })(module, commonjsGlobal);
10678
+ })(module, commonjsGlobal);
10682
10679
  } (bn));
10683
10680
 
10681
+ var bnExports = bn.exports;
10682
+
10684
10683
  var minimalisticAssert = assert$f;
10685
10684
 
10686
10685
  function assert$f(val, msg) {
@@ -10752,7 +10751,7 @@ var utils$n = {};
10752
10751
  return toHex(arr);
10753
10752
  else
10754
10753
  return arr;
10755
- };
10754
+ };
10756
10755
  } (utils$n));
10757
10756
 
10758
10757
  (function (exports) {
@@ -10872,14 +10871,10 @@ var utils$n = {};
10872
10871
  function intFromLE(bytes) {
10873
10872
  return new BN(bytes, 'hex', 'le');
10874
10873
  }
10875
- utils.intFromLE = intFromLE;
10874
+ utils.intFromLE = intFromLE;
10876
10875
  } (utils$o));
10877
10876
 
10878
- var brorandExports = {};
10879
- var brorand = {
10880
- get exports(){ return brorandExports; },
10881
- set exports(v){ brorandExports = v; },
10882
- };
10877
+ var brorand = {exports: {}};
10883
10878
 
10884
10879
  var r$1;
10885
10880
 
@@ -10893,7 +10888,7 @@ brorand.exports = function rand(len) {
10893
10888
  function Rand(rand) {
10894
10889
  this.rand = rand;
10895
10890
  }
10896
- brorandExports.Rand = Rand;
10891
+ brorand.exports.Rand = Rand;
10897
10892
 
10898
10893
  Rand.prototype.generate = function generate(len) {
10899
10894
  return this._rand(len);
@@ -10947,6 +10942,8 @@ if (typeof self === 'object') {
10947
10942
  }
10948
10943
  }
10949
10944
 
10945
+ var brorandExports = brorand.exports;
10946
+
10950
10947
  var curve = {};
10951
10948
 
10952
10949
  var BN$8 = bnExports;
@@ -11328,11 +11325,7 @@ BasePoint.prototype.dblp = function dblp(k) {
11328
11325
  return r;
11329
11326
  };
11330
11327
 
11331
- var inherits_browserExports = {};
11332
- var inherits_browser = {
11333
- get exports(){ return inherits_browserExports; },
11334
- set exports(v){ inherits_browserExports = v; },
11335
- };
11328
+ var inherits_browser = {exports: {}};
11336
11329
 
11337
11330
  if (typeof Object.create === 'function') {
11338
11331
  // implementation from standard node.js 'util' module
@@ -11362,6 +11355,8 @@ if (typeof Object.create === 'function') {
11362
11355
  };
11363
11356
  }
11364
11357
 
11358
+ var inherits_browserExports = inherits_browser.exports;
11359
+
11365
11360
  var utils$l = utils$o;
11366
11361
  var BN$7 = bnExports;
11367
11362
  var inherits$3 = inherits_browserExports;
@@ -12917,7 +12912,7 @@ Point.prototype.mixedAdd = Point.prototype.add;
12917
12912
  curve.base = base;
12918
12913
  curve.short = short;
12919
12914
  curve.mont = mont;
12920
- curve.edwards = edwards;
12915
+ curve.edwards = edwards;
12921
12916
  } (curve));
12922
12917
 
12923
12918
  var curves$2 = {};
@@ -14130,16 +14125,16 @@ Hmac.prototype.digest = function digest(enc) {
14130
14125
  hash.sha224 = hash.sha.sha224;
14131
14126
  hash.sha384 = hash.sha.sha384;
14132
14127
  hash.sha512 = hash.sha.sha512;
14133
- hash.ripemd160 = hash.ripemd.ripemd160;
14128
+ hash.ripemd160 = hash.ripemd.ripemd160;
14134
14129
  } (hash$2));
14135
14130
 
14136
- var secp256k1;
14131
+ var secp256k1$1;
14137
14132
  var hasRequiredSecp256k1;
14138
14133
 
14139
14134
  function requireSecp256k1 () {
14140
- if (hasRequiredSecp256k1) return secp256k1;
14135
+ if (hasRequiredSecp256k1) return secp256k1$1;
14141
14136
  hasRequiredSecp256k1 = 1;
14142
- secp256k1 = {
14137
+ secp256k1$1 = {
14143
14138
  doubles: {
14144
14139
  step: 4,
14145
14140
  points: [
@@ -14919,7 +14914,7 @@ function requireSecp256k1 () {
14919
14914
  ],
14920
14915
  },
14921
14916
  };
14922
- return secp256k1;
14917
+ return secp256k1$1;
14923
14918
  }
14924
14919
 
14925
14920
  (function (exports) {
@@ -15127,7 +15122,7 @@ function requireSecp256k1 () {
15127
15122
  '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',
15128
15123
  pre,
15129
15124
  ],
15130
- });
15125
+ });
15131
15126
  } (curves$2));
15132
15127
 
15133
15128
  var hash$1 = hash$2;
@@ -16056,7 +16051,7 @@ EDDSA.prototype.isPoint = function isPoint(val) {
16056
16051
 
16057
16052
  // Protocols
16058
16053
  elliptic.ec = ec$1;
16059
- elliptic.eddsa = eddsa;
16054
+ elliptic.eddsa = eddsa;
16060
16055
  } (elliptic$2));
16061
16056
 
16062
16057
  const EC = elliptic$2.ec;
@@ -16464,6 +16459,8 @@ var elliptic$1 = {
16464
16459
 
16465
16460
  var elliptic = lib(elliptic$1);
16466
16461
 
16462
+ var secp256k1 = /*@__PURE__*/getDefaultExportFromCjs(elliptic);
16463
+
16467
16464
  const leofcoinOlivia = {
16468
16465
  messagePrefix: '\u0019Leofcoin Signed Message:',
16469
16466
  version: 1,
@@ -16596,7 +16593,7 @@ const decode = async (wif, version) => {
16596
16593
  var wif = { encode, decode };
16597
16594
 
16598
16595
  const HIGHEST_BIT = 0x80000000;
16599
- const { publicKeyCreate, publicKeyVerify, privateKeyVerify, privateKeyTweakAdd, ecdh } = elliptic;
16596
+ const { publicKeyCreate, publicKeyVerify, privateKeyVerify, privateKeyTweakAdd, ecdh } = secp256k1;
16600
16597
  class HdNode {
16601
16598
  #privateKey;
16602
16599
  #publicKey;
@@ -17015,7 +17012,7 @@ class MultiSignature {
17015
17012
  sign(hash, privateKey) {
17016
17013
  if (!hash || !privateKey)
17017
17014
  throw ReferenceError(`${hash ? 'privateKey' : 'hash'} undefined`);
17018
- const { signature } = elliptic.ecdsaSign(hash, privateKey);
17015
+ const { signature } = secp256k1.ecdsaSign(hash, privateKey);
17019
17016
  this.decoded = {
17020
17017
  version: this.version,
17021
17018
  multiCodec: this.multiCodec,
@@ -17027,14 +17024,14 @@ class MultiSignature {
17027
17024
  * verify signature (multiSignature.signature)
17028
17025
  */
17029
17026
  verifySignature(signature, hash, publicKey) {
17030
- return elliptic.ecdsaVerify(signature, hash, publicKey);
17027
+ return secp256k1.ecdsaVerify(signature, hash, publicKey);
17031
17028
  }
17032
17029
  /**
17033
17030
  * verify multiSignature
17034
17031
  */
17035
17032
  verify(multiSignature, hash, publicKey) {
17036
17033
  multiSignature = this.decode(multiSignature);
17037
- return elliptic.ecdsaVerify(multiSignature.signature, hash, publicKey);
17034
+ return secp256k1.ecdsaVerify(multiSignature.signature, hash, publicKey);
17038
17035
  }
17039
17036
  encode(signature) {
17040
17037
  signature = signature || this.signature;
@@ -17432,7 +17429,7 @@ var errorCorrectionLevel = {};
17432
17429
  } catch (e) {
17433
17430
  return defaultValue
17434
17431
  }
17435
- };
17432
+ };
17436
17433
  } (errorCorrectionLevel));
17437
17434
 
17438
17435
  function BitBuffer$1 () {
@@ -17625,7 +17622,7 @@ var alignmentPattern = {};
17625
17622
  }
17626
17623
 
17627
17624
  return coords
17628
- };
17625
+ };
17629
17626
  } (alignmentPattern));
17630
17627
 
17631
17628
  var finderPattern = {};
@@ -17890,7 +17887,7 @@ var maskPattern = {};
17890
17887
  }
17891
17888
 
17892
17889
  return bestPattern
17893
- };
17890
+ };
17894
17891
  } (maskPattern));
17895
17892
 
17896
17893
  var errorCorrectionCode = {};
@@ -18167,7 +18164,7 @@ galoisField.mul = function mul (x, y) {
18167
18164
  }
18168
18165
 
18169
18166
  return poly
18170
- };
18167
+ };
18171
18168
  } (polynomial));
18172
18169
 
18173
18170
  const Polynomial = polynomial;
@@ -18445,7 +18442,7 @@ regex.testAlphanumeric = function testAlphanumeric (str) {
18445
18442
  } catch (e) {
18446
18443
  return defaultValue
18447
18444
  }
18448
- };
18445
+ };
18449
18446
  } (mode));
18450
18447
 
18451
18448
  (function (exports) {
@@ -18611,7 +18608,7 @@ regex.testAlphanumeric = function testAlphanumeric (str) {
18611
18608
  }
18612
18609
 
18613
18610
  return (version << 12) | d
18614
- };
18611
+ };
18615
18612
  } (version));
18616
18613
 
18617
18614
  var formatInfo = {};
@@ -18892,11 +18889,7 @@ KanjiData.prototype.write = function (bitBuffer) {
18892
18889
 
18893
18890
  var kanjiData = KanjiData;
18894
18891
 
18895
- var dijkstraExports = {};
18896
- var dijkstra = {
18897
- get exports(){ return dijkstraExports; },
18898
- set exports(v){ dijkstraExports = v; },
18899
- };
18892
+ var dijkstra = {exports: {}};
18900
18893
 
18901
18894
  (function (module) {
18902
18895
 
@@ -19061,9 +19054,11 @@ var dijkstra = {
19061
19054
  // node.js module exports
19062
19055
  {
19063
19056
  module.exports = dijkstra;
19064
- }
19057
+ }
19065
19058
  } (dijkstra));
19066
19059
 
19060
+ var dijkstraExports = dijkstra.exports;
19061
+
19067
19062
  (function (exports) {
19068
19063
  const Mode = mode;
19069
19064
  const NumericData = numericData;
@@ -19394,7 +19389,7 @@ var dijkstra = {
19394
19389
  return exports.fromArray(
19395
19390
  getSegmentsFromString(data, Utils.isKanjiModeEnabled())
19396
19391
  )
19397
- };
19392
+ };
19398
19393
  } (segments));
19399
19394
 
19400
19395
  const Utils$1 = utils$1;
@@ -19996,7 +19991,7 @@ var utils = {};
19996
19991
  imgData[posDst] = pxColor.a;
19997
19992
  }
19998
19993
  }
19999
- };
19994
+ };
20000
19995
  } (utils));
20001
19996
 
20002
19997
  (function (exports) {
@@ -20062,7 +20057,7 @@ var utils = {};
20062
20057
  const rendererOpts = opts.rendererOpts || {};
20063
20058
 
20064
20059
  return canvasEl.toDataURL(type, rendererOpts.quality)
20065
- };
20060
+ };
20066
20061
  } (canvas));
20067
20062
 
20068
20063
  var svgTag = {};
@@ -20262,7 +20257,7 @@ class Identity {
20262
20257
  globalThis.peernet.selectedAccount = new TextDecoder().decode(selected);
20263
20258
  }
20264
20259
  else {
20265
- const importee = await import(/* webpackChunkName: "generate-account" */ './index-b5c99174-8b90872e.js');
20260
+ const importee = await import(/* webpackChunkName: "generate-account" */ './index-ed935219-188aa3ad.js');
20266
20261
  const { identity, accounts } = await importee.default(password, this.network);
20267
20262
  await globalThis.accountStore.put('public', JSON.stringify({ walletId: identity.walletId }));
20268
20263
  await globalThis.walletStore.put('version', String(1));
@@ -20433,7 +20428,7 @@ class Peernet {
20433
20428
  this.root = options.root;
20434
20429
  const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
20435
20430
  // FolderMessageResponse
20436
- } = await import(/* webpackChunkName: "messages" */ './messages-3a71ed04-db6dbd83.js');
20431
+ } = await import(/* webpackChunkName: "messages" */ './messages-cc3774b5-653c2dbe.js');
20437
20432
  /**
20438
20433
  * proto Object containing protos
20439
20434
  * @type {Object}
@@ -20512,7 +20507,7 @@ class Peernet {
20512
20507
  if (this.#starting || this.#started)
20513
20508
  return;
20514
20509
  this.#starting = true;
20515
- const importee = await import('./client-04e44411-04e44411.js');
20510
+ const importee = await import('./client-020c00d8-020c00d8.js');
20516
20511
  /**
20517
20512
  * @access public
20518
20513
  * @type {PeernetClient}
@@ -1,2 +1,2 @@
1
- export { N as default } from './node-browser-e61b575b.js';
2
- import './index-640d9f36.js';
1
+ export { N as default } from './node-browser-1585d228.js';
2
+ import './index-2d1bd076.js';
@@ -1,5 +1,9 @@
1
1
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
2
 
3
+ function getDefaultExportFromCjs (x) {
4
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5
+ }
6
+
3
7
  function getAugmentedNamespace(n) {
4
8
  if (n.__esModule) return n;
5
9
  var f = n.default;
@@ -28,11 +32,7 @@ function getAugmentedNamespace(n) {
28
32
  return a;
29
33
  }
30
34
 
31
- var bnExports = {};
32
- var bn = {
33
- get exports(){ return bnExports; },
34
- set exports(v){ bnExports = v; },
35
- };
35
+ var bn = {exports: {}};
36
36
 
37
37
  var _nodeResolve_empty = {};
38
38
 
@@ -3391,10 +3391,11 @@ var require$$0 = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1);
3391
3391
  var res = this.imod(a._invmp(this.m).mul(this.r2));
3392
3392
  return res._forceRed(this);
3393
3393
  };
3394
- })(module, commonjsGlobal);
3394
+ })(module, commonjsGlobal);
3395
3395
  } (bn));
3396
3396
 
3397
- var _BN = bnExports;
3397
+ var bnExports = bn.exports;
3398
+ var _BN = /*@__PURE__*/getDefaultExportFromCjs(bnExports);
3398
3399
 
3399
3400
  const version$2 = "logger/5.7.0";
3400
3401
 
@@ -1,5 +1,9 @@
1
1
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2
2
 
3
+ function getDefaultExportFromCjs (x) {
4
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5
+ }
6
+
3
7
  function getAugmentedNamespace(n) {
4
8
  if (n.__esModule) return n;
5
9
  var f = n.default;
@@ -28,11 +32,7 @@ function getAugmentedNamespace(n) {
28
32
  return a;
29
33
  }
30
34
 
31
- var bnExports = {};
32
- var bn = {
33
- get exports(){ return bnExports; },
34
- set exports(v){ bnExports = v; },
35
- };
35
+ var bn = {exports: {}};
36
36
 
37
37
  var _nodeResolve_empty = {};
38
38
 
@@ -3391,10 +3391,11 @@ var require$$0 = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1);
3391
3391
  var res = this.imod(a._invmp(this.m).mul(this.r2));
3392
3392
  return res._forceRed(this);
3393
3393
  };
3394
- })(module, commonjsGlobal);
3394
+ })(module, commonjsGlobal);
3395
3395
  } (bn));
3396
3396
 
3397
- var _BN = bnExports;
3397
+ var bnExports = bn.exports;
3398
+ var _BN = /*@__PURE__*/getDefaultExportFromCjs(bnExports);
3398
3399
 
3399
3400
  const version$2 = "logger/5.7.0";
3400
3401
 
package/exports/chain.js CHANGED
@@ -854,11 +854,10 @@ class Chain extends Contract {
854
854
  return;
855
855
  const lastBlock = await this.#makeRequest(peer, 'lastBlock');
856
856
  if (Object.keys(lastBlock).length > 0) {
857
- if (this.#resolveErrored || lastBlock && lastBlock.index > this.#lastBlock?.index) {
857
+ if (this.#resolveErrored || !this.#lastBlock || lastBlock && lastBlock.index > this.#lastBlock?.index) {
858
858
  // this.#knownBlocks = await this.#makeRequest(peer, 'knownBlocks')
859
859
  this.#resolveErrored = false;
860
- if (lastBlock)
861
- await this.syncChain(lastBlock);
860
+ await this.syncChain(lastBlock);
862
861
  if (await this.hasTransactionToHandle() && !this.#resolveErrored && this.#participating)
863
862
  this.#runEpoch();
864
863
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.4.69",
3
+ "version": "1.4.71",
4
4
  "description": "Official javascript implementation",
5
5
  "exports": {
6
6
  "./node": "./exports/node.js",