mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2026-01-31 12:14:32 +01:00
walletunlocker: expose WalletExists
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user