Skip to content

Commit

Permalink
sync: Short circuit sync status if synced.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeGruffins committed May 13, 2024
1 parent 69bf30b commit 5ce1163
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cgo/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 5ce1163

Please sign in to comment.