@@ -29,6 +29,7 @@ export class StateService {
|
||||
txReplaced$ = new Subject<Transaction>();
|
||||
mempoolTransactions$ = new Subject<Transaction>();
|
||||
blockTransactions$ = new Subject<Transaction>();
|
||||
isLoadingWebSocket$ = new ReplaySubject<boolean>(1);
|
||||
|
||||
live2Chart$ = new Subject<OptimizedMempoolStats>();
|
||||
|
||||
|
||||
@@ -52,16 +52,17 @@ export class WebsocketService {
|
||||
|
||||
this.startSubscription();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
startSubscription(retrying = false) {
|
||||
this.stateService.isLoadingWebSocket$.next(true);
|
||||
if (retrying) {
|
||||
this.stateService.connectionState$.next(1);
|
||||
}
|
||||
this.websocketSubject.next({'action': 'init'});
|
||||
this.subscription = this.websocketSubject
|
||||
.subscribe((response: WebsocketResponse) => {
|
||||
this.stateService.isLoadingWebSocket$.next(false);
|
||||
if (response.blocks && response.blocks.length) {
|
||||
const blocks = response.blocks;
|
||||
blocks.forEach((block: Block) => {
|
||||
|
||||
Reference in New Issue
Block a user