aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-09-13 12:18:04 -0700
committerAdam Soltys <[email protected]>2024-09-13 12:18:04 -0700
commit183315347b3ce6d4057abe05861c39f5d4b1aa46 (patch)
treef8f585af47f620ace424b9418336bf8d840ea1fe /routes
parentb00fee005fc69f79d300fa71a3619d97f4571c23 (diff)
downloadcoinos-server-183315347b3ce6d4057abe05861c39f5d4b1aa46.tar.gz
coinos-server-183315347b3ce6d4057abe05861c39f5d4b1aa46.zip
allow intra-account sends, write wallets to conf file
Diffstat (limited to 'routes')
-rw-r--r--routes/users.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/routes/users.ts b/routes/users.ts
index 83303aa9..25a08ba1 100644
--- a/routes/users.ts
+++ b/routes/users.ts
@@ -1,3 +1,4 @@
+import { appendFile } from "node:fs/promises";
import { g, s, db } from "$lib/db";
import config from "$config";
import { pick, bail, fail, getUser } from "$lib/utils";
@@ -607,7 +608,7 @@ export default {
accounts.push(account);
}
- res.send(accounts);
+ res.send(accounts.reverse());
},
async createAccount(req, res) {
@@ -647,6 +648,8 @@ export default {
await s(`pending:${id}`, 0);
await db.lPush(`${user.id}:accounts`, id);
+ await appendFile("/bitcoin.conf", `wallet=${id}`);
+
res.send(account);
} catch (e) {
bail(res, e.message);