Skip to content

Commit

Permalink
waddrmgr: Put client request first in recovery.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeGruffins committed Feb 27, 2025
1 parent 311812f commit 34a13fb
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,16 +790,24 @@ func (w *Wallet) recovery(chainClient chain.Interface,
if len(recoveryBatch) == recoveryBatchSize || height == bestHeight {
err := walletdb.Update(w.db, func(tx walletdb.ReadWriteTx) error {
ns := tx.ReadWriteBucket(waddrmgrNamespaceKey)
err := w.recoverScopedAddresses(
chainClient, tx, ns, recoveryBatch,
recoveryMgr.State(), scopedMgrs,
)
if err != nil {
return err
}
// TODO: Any error here will roll back this
// entire tx. This may cause the in memory sync
// point to become desyncronized. Refactor so
// that that cannot happen.

Check failure on line 803 in wallet/wallet.go

View workflow job for this annotation

GitHub Actions / Format, compilation and lint check

Duplicate words (that) found (dupword)
for _, block := range blocks {
err := w.Manager.SetSyncedTo(ns, block)
if err != nil {
return err
}
}
return w.recoverScopedAddresses(
chainClient, tx, ns, recoveryBatch,
recoveryMgr.State(), scopedMgrs,
)
return nil

Check failure on line 810 in wallet/wallet.go

View workflow job for this annotation

GitHub Actions / Format, compilation and lint check

return with no blank line before (nlreturn)
})
if err != nil {
return err
Expand Down

0 comments on commit 34a13fb

Please sign in to comment.