aboutsummaryrefslogtreecommitdiffstats
path: root/routes/bitcoin/fee.js
diff options
context:
space:
mode:
Diffstat (limited to 'routes/bitcoin/fee.js')
-rw-r--r--routes/bitcoin/fee.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/routes/bitcoin/fee.js b/routes/bitcoin/fee.js
index af622ca5..fb67c08e 100644
--- a/routes/bitcoin/fee.js
+++ b/routes/bitcoin/fee.js
@@ -1,5 +1,10 @@
+import config from "$config";
+import db from "$db";
+import bc from "$lib/bitcoin";
+import { err } from "$lib/logging";
import { emit } from "$lib/sockets";
import buildTx from "$lib/buildtx";
+import { SATS } from "$lib/utils";
export default async (req, res) => {
let { user } = req;
@@ -57,7 +62,7 @@ export default async (req, res) => {
await bc.walletPassphrase(config.bitcoin.walletpass, 300);
let signed = await bc.signRawTransactionWithWallet(tx.hex);
- decoded = await bc.decodeRawTransaction(signed.hex);
+ let decoded = await bc.decodeRawTransaction(signed.hex);
feeRate = Math.round((tx.fee * SATS * 1000) / decoded.vsize);
res.send({ feeRate, tx });