Fetch block accelerations by height instead of hash

This commit is contained in:
Mononaut 2024-04-04 08:22:55 +00:00
parent 91493e8769
commit 3f97c17af2
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E
3 changed files with 7 additions and 7 deletions

View File

@ -136,7 +136,7 @@ export class BlockPreviewComponent implements OnInit, OnDestroy {
return of(transactions); return of(transactions);
}) })
), ),
this.stateService.env.ACCELERATOR === true && block.height > 819500 ? this.servicesApiService.getAccelerationHistory$({ blockHash: block.id }) : of([]) this.stateService.env.ACCELERATOR === true && block.height > 819500 ? this.servicesApiService.getAccelerationHistory$({ blockHeight: block.height }) : of([])
]); ]);
} }
), ),

View File

@ -345,7 +345,7 @@ export class BlockComponent implements OnInit, OnDestroy {
return of(null); return of(null);
}) })
), ),
this.stateService.env.ACCELERATOR === true && block.height > 819500 ? this.servicesApiService.getAccelerationHistory$({ blockHash: block.id }) : of([]) this.stateService.env.ACCELERATOR === true && block.height > 819500 ? this.servicesApiService.getAccelerationHistory$({ blockHeight: block.height }) : of([])
]); ]);
}) })
) )

View File

@ -98,7 +98,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
fetchCpfp$ = new Subject<string>(); fetchCpfp$ = new Subject<string>();
fetchRbfHistory$ = new Subject<string>(); fetchRbfHistory$ = new Subject<string>();
fetchCachedTx$ = new Subject<string>(); fetchCachedTx$ = new Subject<string>();
fetchAcceleration$ = new Subject<string>(); fetchAcceleration$ = new Subject<number>();
fetchMiningInfo$ = new Subject<{ hash: string, height: number, txid: string }>(); fetchMiningInfo$ = new Subject<{ hash: string, height: number, txid: string }>();
isCached: boolean = false; isCached: boolean = false;
now = Date.now(); now = Date.now();
@ -288,8 +288,8 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
tap(() => { tap(() => {
this.accelerationInfo = null; this.accelerationInfo = null;
}), }),
switchMap((blockHash: string) => { switchMap((blockHeight: number) => {
return this.servicesApiService.getAccelerationHistory$({ blockHash }); return this.servicesApiService.getAccelerationHistory$({ blockHeight });
}), }),
catchError(() => { catchError(() => {
return of(null); return of(null);
@ -482,7 +482,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
this.getTransactionTime(); this.getTransactionTime();
} }
} else { } else {
this.fetchAcceleration$.next(tx.status.block_hash); this.fetchAcceleration$.next(tx.status.block_height);
this.fetchMiningInfo$.next({ hash: tx.status.block_hash, height: tx.status.block_height, txid: tx.txid }); this.fetchMiningInfo$.next({ hash: tx.status.block_hash, height: tx.status.block_height, txid: tx.txid });
this.transactionTime = 0; this.transactionTime = 0;
} }
@ -544,7 +544,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
} else { } else {
this.audioService.playSound('magic'); this.audioService.playSound('magic');
} }
this.fetchAcceleration$.next(block.id); this.fetchAcceleration$.next(block.height);
this.fetchMiningInfo$.next({ hash: block.id, height: block.height, txid: this.tx.txid }); this.fetchMiningInfo$.next({ hash: block.id, height: block.height, txid: this.tx.txid });
} }
}); });