From 1962a6dcf1bb37bb8beb3fc4c0231d5a504a75fe Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 17 Jul 2020 20:55:47 -0700 Subject: memos --- routes/bitcoin/receive.js | 2 ++ routes/bitcoin/send.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'routes/bitcoin') diff --git a/routes/bitcoin/receive.js b/routes/bitcoin/receive.js index 131166bc..f4fd4294 100644 --- a/routes/bitcoin/receive.js +++ b/routes/bitcoin/receive.js @@ -55,6 +55,7 @@ zmqRawTx.on("message", async (topic, message, sequence) => { const currency = invoice ? invoice.currency : user.currency; const rate = invoice ? invoice.rate : app.get("rates")[user.currency]; const tip = invoice ? invoice.tip : 0; + const memo = invoice ? invoice.memo : ''; let confirmed = false; @@ -92,6 +93,7 @@ zmqRawTx.on("message", async (topic, message, sequence) => { user_id: user.id, hash, fee, + memo, amount: value - tip, currency, rate, diff --git a/routes/bitcoin/send.js b/routes/bitcoin/send.js index 2ab28054..fcdcb298 100644 --- a/routes/bitcoin/send.js +++ b/routes/bitcoin/send.js @@ -3,7 +3,7 @@ const reverse = require("buffer-reverse"); module.exports = async (req, res) => { let { user } = req; - let { address, tx } = req.body; + let { address, memo, tx } = req.body; let { hex } = tx; let fee = toSats(tx.fee); @@ -56,6 +56,7 @@ module.exports = async (req, res) => { params = { amount: -total, fee, + memo, account_id: account.id, user_id: user.id, rate: app.get("rates")[user.currency], -- cgit v1.2.3