mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-05 17:05:50 +02:00
lnd: Call loader.UnloadWallet on shutdown
This is required to make restart work for LndMobile builds. Not calling UnloadWallet would make `UnlockWallet` stall forever as the file is already opened.
This commit is contained in:
@@ -81,6 +81,10 @@ type WalletUnlockMsg struct {
|
||||
// ChanBackups a set of static channel backups that should be received
|
||||
// after the wallet has been unlocked.
|
||||
ChanBackups ChannelsToRecover
|
||||
|
||||
// UnloadWallet is a function for unloading the wallet, which should
|
||||
// be called on shutdown.
|
||||
UnloadWallet func() error
|
||||
}
|
||||
|
||||
// UnlockerService implements the WalletUnlocker service used to provide lnd
|
||||
@@ -346,6 +350,7 @@ func (u *UnlockerService) UnlockWallet(ctx context.Context,
|
||||
Passphrase: password,
|
||||
RecoveryWindow: recoveryWindow,
|
||||
Wallet: unlockedWallet,
|
||||
UnloadWallet: loader.UnloadWallet,
|
||||
}
|
||||
|
||||
// Before we return the unlock payload, we'll check if we can extract
|
||||
|
Reference in New Issue
Block a user