balanceofsatoshis 12.6.1 → 12.6.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Versions
2
2
 
3
+ ## 12.6.2
4
+
5
+ - `telegram`: Avoid bot crash when receiving an AMP push payment
6
+
3
7
  ## 12.6.1
4
8
 
5
9
  - `lnurl`: Add support for `channel` to request an inbound channel
package/package.json CHANGED
@@ -36,11 +36,11 @@
36
36
  "ini": "3.0.0",
37
37
  "inquirer": "8.2.2",
38
38
  "ln-accounting": "5.0.6",
39
- "ln-service": "53.14.1",
39
+ "ln-service": "53.15.0",
40
40
  "ln-sync": "3.12.0",
41
41
  "ln-telegram": "3.21.2",
42
42
  "moment": "2.29.3",
43
- "paid-services": "3.15.3",
43
+ "paid-services": "3.15.4",
44
44
  "probing": "2.0.5",
45
45
  "psbt": "2.0.1",
46
46
  "qrcode-terminal": "0.12.0",
@@ -84,5 +84,5 @@
84
84
  "postpublish": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t alexbosworth/balanceofsatoshis --push .",
85
85
  "test": "tap --branches=1 --functions=1 --lines=1 --statements=1 -t 60 test/arrays/*.js test/balances/*.js test/chain/*.js test/display/*.js test/encryption/*.js test/lnd/*.js test/network/*.js test/nodes/*.js test/peers/*.js test/responses/*.js test/routing/*.js test/services/*.js test/swaps/*.js test/tags/*.js test/telegram/*.js test/wallets/*.js"
86
86
  },
87
- "version": "12.6.1"
87
+ "version": "12.6.2"
88
88
  }
@@ -58,6 +58,7 @@ const ask = (n, cbk) => inquirer.prompt(n).then(n => cbk(n));
58
58
  const fileAsDoc = file => new InputFile(file.source, file.filename);
59
59
  const fromName = node => `${node.alias} ${node.public_key.substring(0, 8)}`;
60
60
  const {isArray} = Array;
61
+ const isHash = n => /^[0-9A-F]{64}$/i.test(n);
61
62
  let isBotInit = false;
62
63
  const isNumber = n => !isNaN(n);
63
64
  const limit = 99999;
@@ -694,6 +695,11 @@ module.exports = (args, cbk) => {
694
695
  subscriptions.push(sub);
695
696
 
696
697
  sub.on('invoice_updated', invoice => {
698
+ // Exit early when an invoice has no associated hash
699
+ if (!isHash(invoice.id)) {
700
+ return;
701
+ }
702
+
697
703
  return postSettledInvoice({
698
704
  from: node.from,
699
705
  id: connectedId,