Set outspend fetch limit on transaction level.

This commit is contained in:
softsimon 2020-03-27 01:33:39 +07:00
parent 550a096749
commit af86956836
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7

View File

@ -39,14 +39,13 @@ export class TransactionsListComponent implements OnInit, OnChanges {
if (this.outspends[i]) { if (this.outspends[i]) {
return; 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); observableObject[i] = this.electrsApiService.getOutspends$(tx.txid);
}); });
if (Object.keys(observableObject).length > 100) {
console.log('Too many outspends requests');
return;
}
forkJoin(observableObject) forkJoin(observableObject)
.subscribe((outspends: any) => { .subscribe((outspends: any) => {
const newOutspends = []; const newOutspends = [];