aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-12-29 17:25:30 +0000
committerAdam Soltys <[email protected]>2023-12-29 17:25:33 +0000
commitd74f8697f72ddec2b792a822a18bda43f4ccc9b6 (patch)
treed8fd8def7facfb7c3e0e1a63e043640fc2fb2ac7
parenta5c904e174a78d586b79b766b4b069f948f5d343 (diff)
downloadcoinos-server-d74f8697f72ddec2b792a822a18bda43f4ccc9b6.tar.gz
coinos-server-d74f8697f72ddec2b792a822a18bda43f4ccc9b6.zip
check tx type
-rw-r--r--routes/payments.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/routes/payments.js b/routes/payments.js
index 86ff6578..99ec91e6 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -243,8 +243,12 @@ export default {
},
async confirm({ body: { txid, wallet, type } }, res) {
- let node = type === types.bitcoin ? bc : lq;
try {
+ let node;
+ if (type === types.bitcoin) node = bc;
+ else if (type === types.liquid) node = lq;
+ else fail("unrecognized transaction type");
+
if (wallet === config.bitcoin.wallet) {
let { confirmations, details } = await node.getTransaction(txid);
for (let { address, amount, asset, category, vout } of details) {