Skip to content

Commit

Permalink
FIX: force using specific bitcoind wallet file
Browse files Browse the repository at this point in the history
  • Loading branch information
Overtorment committed Aug 16, 2020
1 parent 002fd6f commit d71bedb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions class/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let config = {
bitcoind: {
rpc: 'http://login:[email protected]:8332',
rpc: 'http://login:[email protected]:8332/wallet/wallet.dat',
},
redis: {
port: 12914,
Expand Down
1 change: 1 addition & 0 deletions controllers/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ router.get('/getbtc', async function(req, res) {
await u.generateAddress();
address = await u.getAddress();
}
u.watchAddress(address);

res.send([{ address }]);
});
Expand Down

0 comments on commit d71bedb

Please sign in to comment.