Merge pull request #4744 from mempool/mononaut/send-nodes

More status page polish
This commit is contained in:
wiz
2024-03-07 18:06:05 +09:00
committed by GitHub
13 changed files with 65 additions and 33 deletions

View File

@@ -49,4 +49,5 @@ export interface HealthCheckHost {
outOfSync: boolean;
unreachable: boolean;
checked: boolean;
lastChecked: number;
}

View File

@@ -18,6 +18,7 @@ interface FailoverHost {
unreachable?: boolean,
preferred?: boolean,
checked: boolean,
lastChecked?: number,
}
class FailoverRouter {
@@ -122,7 +123,7 @@ class FailoverRouter {
}
}
host.checked = true;
host.lastChecked = Date.now();
// switch if the current host is out of sync or significantly slower than the next best alternative
const rankOrder = this.sortHosts();
@@ -361,6 +362,7 @@ class ElectrsApi implements AbstractBitcoinApi {
outOfSync: !!host.outOfSync,
unreachable: !!host.unreachable,
checked: !!host.checked,
lastChecked: host.lastChecked || 0,
}));
} else {
return [];