Skip to content

Commit

Permalink
don't unload wallet if we are still scanning when shutting done
Browse files Browse the repository at this point in the history
  • Loading branch information
ziggie1984 committed Dec 22, 2022
1 parent c8e2f6f commit 55f3690
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bus/infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,11 @@ func (b *Bus) Close(ctx context.Context) {
b.mainClient.Shutdown()
b.secondaryClient.Shutdown()

b.UnloadWallet()
// Only unload wallet if we are not in a pending scan
// otherwise the nuclear timeout corrupts the wallet state
if !b.IsPendingScan {
b.UnloadWallet()
}
done <- true
}()

Expand Down
2 changes: 2 additions & 0 deletions bus/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ func (b *Bus) AbortRescan() error {
"prefix": "AbortRescan",
}).Infof("Abort rescan successful: %t", abortRescan)

b.IsPendingScan = false

return nil

}

0 comments on commit 55f3690

Please sign in to comment.