Merge pull request #4772 from mempool/mononaut/replacement-skeleton

Fix recent replacements skeleton loader
This commit is contained in:
wiz 2024-03-16 17:19:18 +09:00 committed by GitHub
commit dd7c8f2934
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View File

@ -52,7 +52,7 @@ class WebsocketHandler {
private socketData: { [key: string]: string } = {};
private serializedInitData: string = '{}';
private lastRbfSummary: ReplacementInfo | null = null;
private lastRbfSummary: ReplacementInfo[] | null = null;
constructor() { }
@ -464,10 +464,11 @@ class WebsocketHandler {
let rbfReplacements;
let fullRbfReplacements;
let rbfSummary;
if (Object.keys(rbfChanges.trees).length) {
if (Object.keys(rbfChanges.trees).length || !this.lastRbfSummary) {
rbfReplacements = rbfCache.getRbfTrees(false);
fullRbfReplacements = rbfCache.getRbfTrees(true);
rbfSummary = rbfCache.getLatestRbfSummary();
rbfSummary = rbfCache.getLatestRbfSummary() || [];
this.lastRbfSummary = rbfSummary;
}
for (const deletedTx of deletedTransactions) {

View File

@ -330,8 +330,8 @@ export class WebsocketService {
this.stateService.rbfLatest$.next(response.rbfLatest);
}
if (response.rbfLatestSummary) {
this.stateService.rbfLatestSummary$.next(response.rbfLatestSummary);
if (response.rbfLatestSummary !== undefined) {
this.stateService.rbfLatestSummary$.next(response.rbfLatestSummary || []);
}
if (response.txReplaced) {