diff options
| author | Adam Soltys <[email protected]> | 2022-04-30 09:12:20 -0400 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-04-30 09:12:31 -0400 |
| commit | c80408c08ff2a8ca31df5ef3c7c9df13c9f714e4 (patch) | |
| tree | d8c0d505862fa757e7f8751da5116dfb26c3582b /lib | |
| parent | 98ba0e685636bfcaedd560a30192809bc2407aab (diff) | |
| download | coinos-server-c80408c08ff2a8ca31df5ef3c7c9df13c9f714e4.tar.gz coinos-server-c80408c08ff2a8ca31df5ef3c7c9df13c9f714e4.zip | |
remove upper receive range limit for lightning
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sync.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/sync.js b/lib/sync.js index d6adba2e..fedb6798 100644 --- a/lib/sync.js +++ b/lib/sync.js @@ -116,7 +116,7 @@ const sync = async () => { preimage, rate: invoice.rate, received: true, - confirmed: true, + confirmed: false, network: "lightning", tip: invoice.tip, invoice_id: invoice.id, @@ -124,9 +124,9 @@ const sync = async () => { updatedAt: createdAt }); - await account.increment({ balance: amount }); + // await account.increment({ balance: amount }); - l.info("rectified account", account.id, amount); + l.info("lightning missing from account", account.id, amount); } } } @@ -185,7 +185,9 @@ const sync = async () => { transactions.map(tx => { if ( !payments.find(p => p.hash === tx.txid) && - !exceptions.includes(tx.txid) + !exceptions.includes(tx.txid) && + !unaccounted.find(a => a.txid === tx.txid) && + new Date(tx.blocktime * 1000) >= twoWeeksAgo ) { unaccounted.push(tx); } @@ -251,6 +253,8 @@ const sync = async () => { amount = toSats(amount); await db.transaction(async transaction => { + l.info("found pending balance", user.username, amount); + /* payments.push(hash); let p = await db.Payment.create( { @@ -272,10 +276,9 @@ const sync = async () => { await account.increment({ pending: amount }, { transaction }); - l.info("found pending balance", user.username, amount); - emit(user.username, "account", account); emit(user.username, "payment", p); + */ }); } } |
