From 2264d0ff49528269fd20cbbd5822f64fb36e6ce1 Mon Sep 17 00:00:00 2001 From: Matheus Degiovani Date: Fri, 2 Feb 2024 10:30:48 -0300 Subject: [PATCH] wallet: Remove mainchain tip check on NeedsAccountsSync This check could prevent a wallet from going through account discovery if it had not completed the initial chain sync prior to being restarted. One instance this could happen is when restoring SPV wallets under an instable network connection or having a power loss during the initial sync of a restored wallet. --- wallet/wallet.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/wallet/wallet.go b/wallet/wallet.go index c286eaa6e..17307cff6 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -5243,11 +5243,6 @@ func (w *Wallet) ChainParams() *chaincfg.Params { // should be performed to restore, per BIP0044, any generated accounts and // addresses from a restored seed. func (w *Wallet) NeedsAccountsSync(ctx context.Context) (bool, error) { - _, tipHeight := w.MainChainTip(ctx) - if tipHeight != 0 { - return false, nil - } - needsSync := true err := walletdb.View(ctx, w.db, func(tx walletdb.ReadTx) error { addrmgrNs := tx.ReadBucket(waddrmgrNamespaceKey)