diff --git a/backend/src/api/bitcoin/bitcoin-api-abstract-factory.ts b/backend/src/api/bitcoin/bitcoin-api-abstract-factory.ts index abd4c47a5..cc0c801b5 100644 --- a/backend/src/api/bitcoin/bitcoin-api-abstract-factory.ts +++ b/backend/src/api/bitcoin/bitcoin-api-abstract-factory.ts @@ -49,4 +49,5 @@ export interface HealthCheckHost { outOfSync: boolean; unreachable: boolean; checked: boolean; + lastChecked: number; } diff --git a/backend/src/api/bitcoin/esplora-api.ts b/backend/src/api/bitcoin/esplora-api.ts index 9289ab4d1..a9dadf4a0 100644 --- a/backend/src/api/bitcoin/esplora-api.ts +++ b/backend/src/api/bitcoin/esplora-api.ts @@ -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 []; diff --git a/frontend/src/app/components/footer/footer.component.html b/frontend/src/app/components/footer/footer.component.html index 9c0369827..f89e780ff 100644 --- a/frontend/src/app/components/footer/footer.component.html +++ b/frontend/src/app/components/footer/footer.component.html @@ -1,4 +1,4 @@ -