aboutsummaryrefslogtreecommitdiffstats
path: root/routes/payments.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-04-23 06:29:50 +0000
committerAdam Soltys <[email protected]>2024-05-02 21:07:22 +0000
commit3498d1b6f5b1485fc6b823aae1f41a3d718564c6 (patch)
treed8151673cffb4c3040724da9a1709a7c8bca46e1 /routes/payments.js
parent57fa1382102eda6bab845c020d1a6458e4f02122 (diff)
downloadcoinos-server-3498d1b6f5b1485fc6b823aae1f41a3d718564c6.tar.gz
coinos-server-3498d1b6f5b1485fc6b823aae1f41a3d718564c6.zip
log bumps
Diffstat (limited to 'routes/payments.js')
-rw-r--r--routes/payments.js35
1 files changed, 20 insertions, 15 deletions
diff --git a/routes/payments.js b/routes/payments.js
index 403ed51f..5da5017f 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -411,8 +411,10 @@ export default {
let raw = await node.createRawTransaction(tx.vin, outputs);
+ console.log("FEES", fees)
+
let newTx = await node.fundRawTransaction(raw, {
- fee_rate: fees.fastestFee,
+ fee_rate: fees.fastestFee + 50,
replaceable: true,
subtractFeeFromOutputs: [],
});
@@ -420,27 +422,30 @@ export default {
let diff = sats(newTx.fee) - p.fee;
if (diff < 0) fail("fee must increase");
- let ourfee = Math.round(diff * config.fee) || 0;
+ console.log("DIFF", diff)
- ourfee = await db.debit(
- `balance:${uid}`,
- `credit:${type}:${uid}`,
- p.amount || 0,
- 0,
- diff,
- ourfee,
- );
+ // let ourfee = Math.round(diff * config.fee) || 0;
+ //
+ // ourfee = await db.debit(
+ // `balance:${uid}`,
+ // `credit:${type}:${uid}`,
+ // p.amount || 0,
+ // 0,
+ // diff,
+ // ourfee,
+ // );
if (config[type].walletpass)
await node.walletPassphrase(config[type].walletpass, 300);
p.hex = (await node.signRawTransactionWithWallet(newTx.hex)).hex;
let r = await node.testMempoolAccept([p.hex]);
if (!r[0].allowed) fail(`transaction rejected ${p.hex}`);
- p.hash = await node.sendRawTransaction(p.hex);
- p.fee = sats(newTx.fee);
- await s(`payment:${id}`, p);
- await s(`payment:${p.hash}`, id);
- emit(uid, "payment", p);
+ warn("bump", user.username, p.hex);
+ // p.hash = await node.sendRawTransaction(p.hex);
+ // p.fee = sats(newTx.fee);
+ // await s(`payment:${id}`, p);
+ // await s(`payment:${p.hash}`, id);
+ // emit(uid, "payment", p);
res.send({ ok: true });
} catch (e) {