Fix with null result TXs fetcher
This commit is contained in:
parent
27ebe36b4b
commit
f624ced5ce
@ -282,13 +282,14 @@ export class User {
|
|||||||
let txs = await this._bitcoindrpc.request('listtransactions', [addr, 100500, 0, true]);
|
let txs = await this._bitcoindrpc.request('listtransactions', [addr, 100500, 0, true]);
|
||||||
txs = txs.result;
|
txs = txs.result;
|
||||||
let result = [];
|
let result = [];
|
||||||
for (let tx of txs) {
|
if(!txs===null) {
|
||||||
if (tx.confirmations >= 3) {
|
for (let tx of txs) {
|
||||||
tx.type = 'bitcoind_tx';
|
if (tx.confirmations >= 3) {
|
||||||
result.push(tx);
|
tx.type = 'bitcoind_tx';
|
||||||
|
result.push(tx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let range = await this._redis.lrange('txs_for_' + this._userid, 0, -1);
|
let range = await this._redis.lrange('txs_for_' + this._userid, 0, -1);
|
||||||
for (let invoice of range) {
|
for (let invoice of range) {
|
||||||
invoice = JSON.parse(invoice);
|
invoice = JSON.parse(invoice);
|
||||||
@ -311,9 +312,7 @@ export class User {
|
|||||||
delete invoice.payment_route;
|
delete invoice.payment_route;
|
||||||
delete invoice.pay_req;
|
delete invoice.pay_req;
|
||||||
delete invoice.decoded;
|
delete invoice.decoded;
|
||||||
result.push(invoice);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -332,9 +331,11 @@ export class User {
|
|||||||
let txs = await this._bitcoindrpc.request('listtransactions', [addr, 100500, 0, true]);
|
let txs = await this._bitcoindrpc.request('listtransactions', [addr, 100500, 0, true]);
|
||||||
txs = txs.result;
|
txs = txs.result;
|
||||||
let result = [];
|
let result = [];
|
||||||
for (let tx of txs) {
|
if(!txs === null) {
|
||||||
if (tx.confirmations < 3) {
|
for (let tx of txs) {
|
||||||
result.push(tx);
|
if (tx.confirmations < 3) {
|
||||||
|
result.push(tx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user