Issue #12: Fetching all on-chain txs and filtering based on user's address. Note: This permits running LndHub without -deprecatedrpc=accounts switch.

This commit is contained in:
alerobrod 2019-02-06 21:44:34 +00:00 committed by Igor Korsakov
parent 70262b1059
commit 16c6d167da

View File

@ -285,11 +285,11 @@ export class User {
addr = await this.getAddress();
}
if (!addr) throw new Error('cannot get transactions: no onchain address assigned to user');
let txs = await this._bitcoindrpc.request('listtransactions', [addr, 100500, 0, true]);
let txs = await this._bitcoindrpc.request('listtransactions', ['*', 100500, 0, true]);
txs = txs.result;
let result = [];
for (let tx of txs) {
if (tx.confirmations >= 3) {
if (tx.confirmations >= 3 && tx.address === addr) {
tx.type = 'bitcoind_tx';
result.push(tx);
}
@ -335,11 +335,11 @@ export class User {
addr = await this.getAddress();
}
if (!addr) throw new Error('cannot get transactions: no onchain address assigned to user');
let txs = await this._bitcoindrpc.request('listtransactions', [addr, 100500, 0, true]);
let txs = await this._bitcoindrpc.request('listtransactions', ['*', 100500, 0, true]);
txs = txs.result;
let result = [];
for (let tx of txs) {
if (tx.confirmations < 3) {
if (tx.confirmations < 3 && tx.address === addr) {
result.push(tx);
}
}