From 16c6d167da765467267337a30feb01406f9504da Mon Sep 17 00:00:00 2001 From: alerobrod Date: Wed, 6 Feb 2019 21:44:34 +0000 Subject: [PATCH] Issue #12: Fetching all on-chain txs and filtering based on user's address. Note: This permits running LndHub without -deprecatedrpc=accounts switch. --- class/User.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/class/User.js b/class/User.js index 086956e..792e0ae 100644 --- a/class/User.js +++ b/class/User.js @@ -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); } }