aboutsummaryrefslogtreecommitdiffstats
path: root/routes/bitcoin
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-07-17 20:55:47 -0700
committerAdam Soltys <[email protected]>2020-07-17 20:55:59 -0700
commit1962a6dcf1bb37bb8beb3fc4c0231d5a504a75fe (patch)
tree46ffa53e3f7ebbdb2ea9c9abd1cf64405e1410cd /routes/bitcoin
parent4a8abaa2722b629cebebb677249c3fd4f51292fb (diff)
downloadcoinos-server-1962a6dcf1bb37bb8beb3fc4c0231d5a504a75fe.tar.gz
coinos-server-1962a6dcf1bb37bb8beb3fc4c0231d5a504a75fe.zip
memos
Diffstat (limited to 'routes/bitcoin')
-rw-r--r--routes/bitcoin/receive.js2
-rw-r--r--routes/bitcoin/send.js3
2 files changed, 4 insertions, 1 deletions
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],