From 5eb6950c8f6dfea83c230c403c51c64234f23e3d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 27 Jan 2020 09:52:01 -0800 Subject: generate new address on receive --- bitcoinPayments.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bitcoinPayments.js') diff --git a/bitcoinPayments.js b/bitcoinPayments.js index 90d7836a..abdc072d 100644 --- a/bitcoinPayments.js +++ b/bitcoinPayments.js @@ -71,9 +71,10 @@ module.exports = (app, bc, db, addresses, payments, emit) => { user.pending += o.value; } + user.address = await bc.getNewAddress("", "bech32"); + addresses[user.address] = user.username; await user.save(); emit(user.username, "user", user); - l("output:", o); const payment = await db.Payment.create({ user_id: user.id, -- cgit v1.2.3