From 5ce1163a5d7bc6c4eba17e450bd15f5f62ea1c9c Mon Sep 17 00:00:00 2001 From: JoeGruff Date: Fri, 10 May 2024 17:07:48 +0900 Subject: [PATCH] sync: Short circuit sync status if synced. --- cgo/sync.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cgo/sync.go b/cgo/sync.go index 6aeab78..98c3daa 100644 --- a/cgo/sync.go +++ b/cgo/sync.go @@ -122,6 +122,17 @@ func syncWalletStatus(cName *C.char) *C.char { } targetHeight := spvSyncer.EstimateMainChainTip(ctx) + // Sometimes it appears we miss a notification during start up. This is + // a bandaid to put us as synced in that case. + // + // TODO: Figure out why we would miss a notification. + if w.IsSynced() { + w.syncStatusMtx.Lock() + ssc = SSCComplete + w.syncStatusCode = ssc + w.syncStatusMtx.Unlock() + } + ss := &SyncStatusRes{ SyncStatusCode: int(ssc), SyncStatus: ssc.String(),