aboutsummaryrefslogtreecommitdiffstats
path: root/routes/users.ts
diff options
context:
space:
mode:
Diffstat (limited to 'routes/users.ts')
-rw-r--r--routes/users.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/routes/users.ts b/routes/users.ts
index a7188552..3d9602cf 100644
--- a/routes/users.ts
+++ b/routes/users.ts
@@ -21,7 +21,7 @@ import { authenticator } from "otplib";
import { v4 } from "uuid";
import { PaymentType } from "$lib/types";
-import { reconcile } from "$lib/payments";
+import { importAccountHistory } from "$lib/payments";
import type { ProfilePointer } from "nostr-tools/nip19";
const { host } = new URL(process.env.URL);
@@ -834,6 +834,9 @@ export default {
for (const id of await db.lRange(`${user.id}:accounts`, 0, -1)) {
const account = await g(`account:${id}`);
if (account) {
+ if (account.seed && account.pubkey && !account.importedAt) {
+ await importAccountHistory(account);
+ }
account.balance = await g(`balance:${id}`);
accounts.push(account);
}
@@ -884,6 +887,7 @@ export default {
nextIndex: 0,
arkAddress,
accountIndex,
+ importedAt: seed ? Date.now() : undefined,
};
// ARK accounts don't need Bitcoin Core wallet setup
@@ -940,8 +944,6 @@ export default {
.lPush(`${user.id}:accounts`, id)
.exec();
- reconcile(account, true);
-
res.send(account);
} catch (e) {
bail(res, e.message);