walletunlocker: expose WalletExists
This commit is contained in:
parent
5e9e03858d
commit
0d7763fb96
@ -160,6 +160,17 @@ func New(chainDir string, params *chaincfg.Params, noFreelistSync bool,
|
||||
}
|
||||
}
|
||||
|
||||
// WalletExists returns whether a wallet exists on the file path the
|
||||
// UnlockerService is using.
|
||||
func (u *UnlockerService) WalletExists() (bool, error) {
|
||||
netDir := btcwallet.NetworkDir(u.chainDir, u.netParams)
|
||||
loader := wallet.NewLoader(
|
||||
u.netParams, netDir, u.noFreelistSync, u.dbTimeout, 0,
|
||||
)
|
||||
|
||||
return loader.WalletExists()
|
||||
}
|
||||
|
||||
// GenSeed is the first method that should be used to instantiate a new lnd
|
||||
// instance. This method allows a caller to generate a new aezeed cipher seed
|
||||
// given an optional passphrase. If provided, the passphrase will be necessary
|
||||
|
Loading…
Reference in New Issue
Block a user