diff options
| author | Adam Soltys <[email protected]> | 2026-03-11 22:30:37 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-03-11 22:30:37 -0700 |
| commit | 05119b32f331ee97130a5300feb5c02f791aac80 (patch) | |
| tree | cf36ee343b39cd598a4ef6c3627bb2750686b37a | |
| parent | e6938fb6c4cf6e6f3b3c7aa5c7b1d8f28c745031 (diff) | |
| download | coinos-server-05119b32f331ee97130a5300feb5c02f791aac80.tar.gz coinos-server-05119b32f331ee97130a5300feb5c02f791aac80.zip | |
remove bumpestimate
| -rw-r--r-- | index.ts | 1 | ||||
| -rw-r--r-- | routes/payments.ts | 34 |
2 files changed, 7 insertions, 28 deletions
@@ -119,7 +119,6 @@ app.post("/send/:lnaddress/:amount", auth, payments.lnaddress); app.post("/send", auth, payments.internal); app.post("/gateway", payments.gateway); app.post("/bump", auth, payments.bump); -app.post("/bump/estimate", auth, payments.bumpEstimate); app.get("/decode/:bolt11", payments.decode); app.post("/fetchinvoice", payments.fetchinvoice); app.get("/ark/address", payments.arkAddress); diff --git a/routes/payments.ts b/routes/payments.ts index ab876823..f9688d2b 100644 --- a/routes/payments.ts +++ b/routes/payments.ts @@ -9,7 +9,7 @@ import { replay } from "$lib/lightning"; import ln from "$lib/ln"; import { err, l, warn } from "$lib/logging"; import mqtt from "$lib/mqtt"; -import { createCpfpChild, estimateBumpCost } from "$lib/cpfp"; +import { createCpfpChild } from "$lib/cpfp"; import { acquireArkLock, build, @@ -759,7 +759,7 @@ export default { async bump(c) { const body = await c.req.json(); - const { id, targetFeeRate } = body; + const { id } = body; const user = c.get("user"); try { const p = await gf(`payment:${id}`); @@ -770,6 +770,11 @@ export default { if (!p.bumpReserve || p.bumpReserve <= 0) fail("no bump reserve available"); if (p.childTxid) fail("transaction already bumped"); + const fees: any = await fetch(`${api[PaymentType.bitcoin]}/fees/recommended`).then((r) => + r.json(), + ); + const targetFeeRate = Math.ceil(fees.fastestFee * 1.5); + const { txid, childFee } = await createCpfpChild(p, targetFeeRate); return c.json({ @@ -783,31 +788,6 @@ export default { } }, - async bumpEstimate(c) { - const body = await c.req.json(); - const { id, targetFeeRate } = body; - const user = c.get("user"); - try { - const p = await gf(`payment:${id}`); - if (!p) fail("Payment not found"); - if (p.uid !== user.id) fail("unauthorized"); - - const cost = estimateBumpCost(p.fee, p.parentVsize, targetFeeRate); - - const fees: any = await fetch(`${api[PaymentType.bitcoin]}/fees/recommended`).then((r) => - r.json(), - ); - - return c.json({ - cost, - fees, - bumpReserve: p.bumpReserve || 0, - }); - } catch (e) { - return bail(c, e.message); - } - }, - async internal(c) { const body = await c.req.json(); const { username, amount } = body; |
