balanceofsatoshis 25.6.1 → 25.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
+ ## 25.6.2
4
+
5
+ - `telegram`: Fix invoices settled before the bot started being reported as new
6
+
3
7
  ## 25.6.1
4
8
 
5
9
  - Add support for LND 0.21.6 and LND 0.20.7
package/package.json CHANGED
@@ -103,5 +103,5 @@
103
103
  "reinstall-dependencies": "rm -rf node_modules package-lock.json && npm i",
104
104
  "test": "node --experimental-test-coverage --test test/arrays/*.js test/balances/*.js test/chain/*.js test/commands/*.js test/display/*.js test/encryption/*.js test/lnd/*.js test/lnurl/*.js test/network/*.js test/nodes/*.js test/offchain/*.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"
105
105
  },
106
- "version": "25.6.1"
106
+ "version": "25.6.2"
107
107
  }
@@ -729,6 +729,7 @@ module.exports = (args, cbk) => {
729
729
  // Subscribe to invoices
730
730
  invoices: ['getNodes', 'userId', ({getNodes}, cbk) => {
731
731
  return asyncEach(getNodes, (node, cbk) => {
732
+ const start = new Date().toISOString();
732
733
  const sub = subscribeToInvoices({lnd: node.lnd});
733
734
 
734
735
  subscriptions.push(sub);
@@ -739,6 +740,11 @@ module.exports = (args, cbk) => {
739
740
  return;
740
741
  }
741
742
 
743
+ // Exit early when the invoice was settled before subscribing
744
+ if (!!invoice.confirmed_at && invoice.confirmed_at < start) {
745
+ return;
746
+ }
747
+
742
748
  return postSettledInvoice({
743
749
  from: node.from,
744
750
  id: connectedId,