Add electrsApiService cachedRequest function, switch outspends
This commit is contained in:
@@ -75,7 +75,7 @@ export class TransactionsListComponent implements OnInit, OnChanges {
|
||||
for (let i = 0; i < txIds.length; i += 50) {
|
||||
batches.push(txIds.slice(i, i + 50));
|
||||
}
|
||||
return forkJoin(batches.map(batch => this.electrsApiService.getOutspendsBatched$(batch)));
|
||||
return forkJoin(batches.map(batch => { return this.electrsApiService.cachedRequest(this.electrsApiService.getOutspendsBatched$, 250, batch); }));
|
||||
} else {
|
||||
return of([]);
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ export class TxBowtieGraphComponent implements OnInit, OnChanges {
|
||||
.pipe(
|
||||
switchMap((txid) => {
|
||||
if (!this.cached) {
|
||||
return this.electrsApiService.getOutspendsBatched$([txid]);
|
||||
return this.electrsApiService.cachedRequest(this.electrsApiService.getOutspendsBatched$, 250, [txid]);
|
||||
} else {
|
||||
return of(null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user