aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sync.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sync.js')
-rw-r--r--lib/sync.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/sync.js b/lib/sync.js
index dda83eab..10e857b3 100644
--- a/lib/sync.js
+++ b/lib/sync.js
@@ -173,12 +173,13 @@ const sync = async () => {
missed = transactions.filter(
tx =>
tx.category === "receive" &&
- tx.confirmations > 0 &&
+ tx.confirmations > 2 &&
hashes.includes(tx.txid)
);
for (let i = 0; i < missed.length; i++) {
let p = unconfirmed.find(p => p.hash === missed[i].txid);
+ /*
p.confirmed = 1;
await db.transaction(async transaction => {
@@ -190,8 +191,9 @@ const sync = async () => {
emit(p.user.username, "account", p.account);
emit(p.user.username, "payment", p);
+ */
- l.info("confirmed tx", p.user_id, p.hash, p.address);
+ l.info("unconfirmed tx", p.user_id, p.hash, p.address);
}
unaccounted = [];
@@ -286,10 +288,11 @@ const sync = async () => {
} catch (e) {
l.error("sync check failed", e.message, e.stack);
}
+
+ setTimeout(sync, 300000);
};
setTimeout(sync, 5000);
-setInterval(sync, 300000);
app.get(
"/conversions",