From af86956836b127c0bbc44bfc50fc5eb9f4590232 Mon Sep 17 00:00:00 2001 From: softsimon Date: Fri, 27 Mar 2020 01:33:39 +0700 Subject: [PATCH] Set outspend fetch limit on transaction level. --- .../transactions-list/transactions-list.component.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/components/transactions-list/transactions-list.component.ts b/frontend/src/app/components/transactions-list/transactions-list.component.ts index 79e4ed84e..242bf9102 100644 --- a/frontend/src/app/components/transactions-list/transactions-list.component.ts +++ b/frontend/src/app/components/transactions-list/transactions-list.component.ts @@ -39,14 +39,13 @@ export class TransactionsListComponent implements OnInit, OnChanges { if (this.outspends[i]) { return; } + if (tx.vin.length + tx.vout.length > 50) { + console.log('Too many outspends on transaction: ', tx.txid); + return; + } observableObject[i] = this.electrsApiService.getOutspends$(tx.txid); }); - if (Object.keys(observableObject).length > 100) { - console.log('Too many outspends requests'); - return; - } - forkJoin(observableObject) .subscribe((outspends: any) => { const newOutspends = [];