aboutsummaryrefslogtreecommitdiffstats
path: root/routes/liquid
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-06-28 15:23:48 -0700
committerAdam Soltys <[email protected]>2022-06-28 15:27:17 -0700
commit3a85decd016e1f654fef05f331d5e43abba4589d (patch)
treeefec1e3105c76e772b287a71f8a8960080b314d5 /routes/liquid
parent5714a476f5425a541156b6afce22be09e918a554 (diff)
downloadcoinos-server-3a85decd016e1f654fef05f331d5e43abba4589d.tar.gz
coinos-server-3a85decd016e1f654fef05f331d5e43abba4589d.zip
deduct conversion fee from lightning payments
Diffstat (limited to 'routes/liquid')
-rw-r--r--routes/liquid/send.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/routes/liquid/send.js b/routes/liquid/send.js
index 254972ad..c3b37e94 100644
--- a/routes/liquid/send.js
+++ b/routes/liquid/send.js
@@ -155,11 +155,12 @@ sendLiquid = async ({ asset, amount, user, address, memo, tx, limit }) => {
transaction
});
+ let fee_payment;
let fee_payment_id = null;
if (conversionFee) {
await receiverAccount.increment({ balance: conversionFee }, { transaction });
await receiverAccount.reload({ transaction });
- let fee_payment = {
+ fee_payment = {
amount: conversionFee,
fee: 0,
memo: "Liquid conversion fee",
@@ -209,6 +210,7 @@ sendLiquid = async ({ asset, amount, user, address, memo, tx, limit }) => {
p = await db.Payment.create(p, { transaction });
if (account.ticker !== "BTC" || !main) {
main = p.get({ plain: true });
+ main.fee_payment = fee_payment && fee_payment.get({ plain: true });
main.account = account.get({ plain: true });
}
}