aboutsummaryrefslogtreecommitdiffstats
path: root/bitcoinPayments.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2020-01-27 09:52:01 -0800
committerAdam Soltys <[email protected]>2020-01-27 09:52:01 -0800
commit5eb6950c8f6dfea83c230c403c51c64234f23e3d (patch)
treef0973cc09177990457b1fe338b0d25082ed36a01 /bitcoinPayments.js
parente527ae46599e3328917a8d84fb49751c955d5cbd (diff)
downloadcoinos-server-5eb6950c8f6dfea83c230c403c51c64234f23e3d.tar.gz
coinos-server-5eb6950c8f6dfea83c230c403c51c64234f23e3d.zip
generate new address on receive
Diffstat (limited to 'bitcoinPayments.js')
-rw-r--r--bitcoinPayments.js3
1 files changed, 2 insertions, 1 deletions
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,