beignet 0.30.0 → 0.30.1

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 (32) hide show
  1. package/dist/cli/beignet-node.js +7 -0
  2. package/dist/cli/beignet-node.js.map +1 -1
  3. package/dist/cli/cli.js +7 -2
  4. package/dist/cli/cli.js.map +1 -1
  5. package/dist/cli/restore.js +47 -1
  6. package/dist/cli/restore.js.map +1 -1
  7. package/dist/lightning/channel/dual-funding.js +3 -8
  8. package/dist/lightning/channel/dual-funding.js.map +1 -1
  9. package/dist/lightning/channel/validation.js +2 -1
  10. package/dist/lightning/channel/validation.js.map +1 -1
  11. package/dist/lightning/node/lightning-node.js +11 -7
  12. package/dist/lightning/node/lightning-node.js.map +1 -1
  13. package/dist/lightning/storage/durable-ledger.js +9 -2
  14. package/dist/lightning/storage/durable-ledger.js.map +1 -1
  15. package/dist/lightning/storage/sqlite-storage.js +4 -3
  16. package/dist/lightning/storage/sqlite-storage.js.map +1 -1
  17. package/dist/lightning/swaps/reverse-engine.js +2 -1
  18. package/dist/lightning/swaps/reverse-engine.js.map +1 -1
  19. package/dist/transaction/index.js +23 -11
  20. package/dist/transaction/index.js.map +1 -1
  21. package/dist/types/cli/restore.d.ts +8 -0
  22. package/dist/types/lightning/channel/validation.d.ts +1 -0
  23. package/dist/types/lightning/storage/durable-ledger.d.ts +2 -1
  24. package/dist/types/wallet/constants.d.ts +0 -7
  25. package/dist/types/wallet/index.d.ts +6 -2
  26. package/dist/utils/wallet.js +3 -3
  27. package/dist/utils/wallet.js.map +1 -1
  28. package/dist/wallet/constants.js +1 -9
  29. package/dist/wallet/constants.js.map +1 -1
  30. package/dist/wallet/index.js +25 -6
  31. package/dist/wallet/index.js.map +1 -1
  32. package/package.json +1 -1
@@ -45,6 +45,7 @@ const wallet_3 = require("../types/wallet");
45
45
  const wallet_storage_1 = require("./wallet-storage");
46
46
  const onchain_sweep_1 = require("./onchain-sweep");
47
47
  const fs_utils_1 = require("./fs-utils");
48
+ const restore_1 = require("./restore");
48
49
  const backup_mac_1 = require("./backup-mac");
49
50
  const node_storage_view_1 = require("./node-storage-view");
50
51
  const electrum_1 = require("../types/electrum");
@@ -928,6 +929,12 @@ class BeignetNode extends events_1.EventEmitter {
928
929
  }, encryptionKey ? { encryptionKey } : undefined);
929
930
  this.storage.open();
930
931
  this._bootOpts = opts;
932
+ const dbRestore = (0, restore_1.holdDbRestoredChannels)(dbPath, this.storage);
933
+ if (dbRestore) {
934
+ this.log('warn', 'Database was restored from a backup that cannot be proven ' +
935
+ 'current, so its channels are held: no automatic force close and ' +
936
+ 'no new HTLCs. Closing one from this node needs acceptStaleStateRisk', { ...dbRestore });
937
+ }
931
938
  await this.prepareRecovery(opts);
932
939
  if (this._recoveryAutoApply && this.recoveryMode !== 'peer-storage') {
933
940
  throw new errors_1.BeignetError('INVALID_PARAMS', 'recoveryAutoApply applies to peer-storage mode only');