From d71bedbcd184c298d55da97d1b89e6a6e58b3863 Mon Sep 17 00:00:00 2001 From: Overtorment Date: Sun, 16 Aug 2020 15:18:30 +0100 Subject: [PATCH] FIX: force using specific bitcoind wallet file --- class/User.js | 5 +++++ config.js | 2 +- controllers/api.js | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/class/User.js b/class/User.js index 1c043ea..6ad9af5 100644 --- a/class/User.js +++ b/class/User.js @@ -124,6 +124,11 @@ export class User { }); } + async watchAddress(address) { + if (!address) return; + return this._bitcoindrpc.request('importaddress', [address, address, false]); + } + /** * LndHub no longer relies on redis balance as source of truth, this is * more a cache now. See `this.getCalculatedBalance()` to get correct balance. diff --git a/config.js b/config.js index 1cc68ec..b8381a4 100644 --- a/config.js +++ b/config.js @@ -1,6 +1,6 @@ let config = { bitcoind: { - rpc: 'http://login:password@1.1.1.1:8332', + rpc: 'http://login:password@1.1.1.1:8332/wallet/wallet.dat', }, redis: { port: 12914, diff --git a/controllers/api.js b/controllers/api.js index 5cfba4d..9cc2527 100644 --- a/controllers/api.js +++ b/controllers/api.js @@ -319,6 +319,7 @@ router.get('/getbtc', async function(req, res) { await u.generateAddress(); address = await u.getAddress(); } + u.watchAddress(address); res.send([{ address }]); });