wallet/chainntfns: ensure safe shutdown during sync
This commit is contained in:
parent
74a7124666
commit
78ea2cdc9c
1 changed files with 10 additions and 2 deletions
|
@ -128,12 +128,20 @@ func (w *Wallet) handleChainNotifications() {
|
|||
case *chain.RescanProgress:
|
||||
err = catchUpHashes(w, chainClient, n.Height)
|
||||
notificationName = "rescanprogress"
|
||||
w.rescanNotifications <- n
|
||||
select {
|
||||
case w.rescanNotifications <- n:
|
||||
case <-w.quitChan():
|
||||
return
|
||||
}
|
||||
case *chain.RescanFinished:
|
||||
err = catchUpHashes(w, chainClient, n.Height)
|
||||
notificationName = "rescanprogress"
|
||||
w.SetChainSynced(true)
|
||||
w.rescanNotifications <- n
|
||||
select {
|
||||
case w.rescanNotifications <- n:
|
||||
case <-w.quitChan():
|
||||
return
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
// On out-of-sync blockconnected notifications, only
|
||||
|
|
Loading…
Reference in a new issue