ExchangeUnion / xud

Exchange Union Daemon 🔁 ⚡️
https://exchangeunion.com
GNU Affero General Public License v3.0
115 stars 49 forks source link

feat(swapclient): auto init wallets on xud unlock #1973

Closed sangaman closed 3 years ago

sangaman commented 3 years ago

This adds a new feature to xud to automatically attempt to create a wallet for any new swap client configured after an xud node has been created. Effectively this only changes the behavior for lnd clients, as this is already the existing behavior for Connext. The process for initializing has now been standardized instead of the ad hoc approach used previously.

If xud tries to unlock an lnd node and gets an error message indicating that the wallet has not been created, then it will generate a client & currency specific seed mnemonic using seedutil and call InitWallet with that seed and the existing xud password, such that the wallet funds and node identity for the new lnd client can be unlocked and restored along with the rest of lnd.

Closes #1929.

This PR replaces #1961.