wallet: ensure rescan is launched with all addresses

During the time of initial block hash catch-up, it is possible to
request an address be generated. This commit updates the active
addresses by calling `w.activeData` after the catch-up is complete.
This commit is contained in:
Alex 2017-09-21 16:14:39 -06:00 committed by Olaoluwa Osuntokun
parent 5113a64617
commit 5c69110f47

View file

@ -453,6 +453,19 @@ func (w *Wallet) syncWithChain() error {
return err
}
log.Info("Done catching up block hashes")
// Since we've spent some time catching up block hashes, we
// might have new addresses waiting for us that were requested
// during initial sync. Make sure we have those before we
// request a rescan later on.
err = walletdb.View(w.db, func(dbtx walletdb.ReadTx) error {
var err error
addrs, unspent, err = w.activeData(dbtx)
return err
})
if err != nil {
return err
}
}
// Compare previously-seen blocks against the chain server. If any of