Skip to content

Commit

Permalink
wallet: Remove mainchain tip check on NeedsAccountsSync
Browse files Browse the repository at this point in the history
This check could prevent a wallet from going through address 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.
  • Loading branch information
matheusd committed Feb 2, 2024
1 parent 6cde2cc commit 796fb76
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 796fb76

Please sign in to comment.