aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2021-08-04 17:08:25 -0700
committerAdam Soltys <[email protected]>2021-08-04 17:08:48 -0700
commit5858323cf0bb920c9f967239b7a1ef7915cf0824 (patch)
treed3f325604adb5b057501ff2ae9c57e3a0f678b23
parentdb5888df67d7120c0ee5d77f36ddcedbeae5455e (diff)
downloadcoinos-server-5858323cf0bb920c9f967239b7a1ef7915cf0824.tar.gz
coinos-server-5858323cf0bb920c9f967239b7a1ef7915cf0824.zip
don't wait for webhook to complete
-rw-r--r--routes/assets.js11
-rw-r--r--routes/bitcoin/receive.js4
-rw-r--r--routes/lightning/receive.js2
-rw-r--r--routes/liquid/receive.js2
4 files changed, 14 insertions, 5 deletions
diff --git a/routes/assets.js b/routes/assets.js
index fe667dd9..939eb76c 100644
--- a/routes/assets.js
+++ b/routes/assets.js
@@ -111,7 +111,15 @@ app.post(
if (filename) contract.filename = filename;
- l.info("attempting issuance", req.user.username, contract, "address", address, "pubkey", pubkey);
+ l.info(
+ "attempting issuance",
+ req.user.username,
+ contract,
+ "address",
+ address,
+ "pubkey",
+ pubkey
+ );
sha256.update(JSON.stringify(contract));
const hash = sha256.digest("hex");
@@ -128,6 +136,7 @@ app.post(
contract_hash
};
+
params.asset_amount = asset_amount / (SATS / 10 ** precision);
if (token_amount) {
diff --git a/routes/bitcoin/receive.js b/routes/bitcoin/receive.js
index d782627d..67ccdb45 100644
--- a/routes/bitcoin/receive.js
+++ b/routes/bitcoin/receive.js
@@ -114,7 +114,7 @@ zmqRawTx.on("message", async (topic, message, sequence) => {
emit(user.username, "payment", payment);
l.info("bitcoin detected", user.username, value);
notify(user, `${value} SAT payment detected`);
- await callWebhook(invoice, payment);
+ callWebhook(invoice, payment);
}
} catch (e) {
console.log(e);
@@ -189,7 +189,7 @@ setInterval(async () => {
emit(user.username, "payment", p);
l.info("bitcoin confirmed", user.username, p.amount, p.tip);
notify(user, `${total} SAT payment confirmed`);
- await callWebhook(p.invoice, p);
+ callWebhook(p.invoice, p);
} else {
l.warn("couldn't find bitcoin payment", hash);
}
diff --git a/routes/lightning/receive.js b/routes/lightning/receive.js
index 8d2aa750..39c5be15 100644
--- a/routes/lightning/receive.js
+++ b/routes/lightning/receive.js
@@ -67,7 +67,7 @@ const handlePayment = async msg => {
payment = payment.get({ plain: true });
payment.account = account.get({ plain: true });
- await callWebhook(invoice, payment);
+ callWebhook(invoice, payment);
emit(user.username, "payment", payment);
emit(user.username, "account", payment.account);
diff --git a/routes/liquid/receive.js b/routes/liquid/receive.js
index 259db7c7..d3d4aec8 100644
--- a/routes/liquid/receive.js
+++ b/routes/liquid/receive.js
@@ -175,7 +175,7 @@ zmqRawTx.on("message", async (topic, message, sequence) => {
emit(user.username, "account", payment.account);
l.info("liquid detected", address, user.username, asset, value);
notify(user, `${value} SAT payment detected`);
- await callWebhook(invoice, payment);
+ callWebhook(invoice, payment);
});
}
} catch (e) {