Skip to content
Permalink
Browse files

fix(lnd): ensure id is generated for new wallets

  • Loading branch information...
korhaliv committed May 22, 2019
1 parent e0ddcd5 commit cd7c61b8a299e6d9ef9935923d788f1b16dad172
Showing with 8 additions and 1 deletion.
  1. +8 −1 renderer/reducers/lnd.js
@@ -286,7 +286,14 @@ export const setLightningGrpcActive = () => async (dispatch, getState) => {
// after connection was successfully established. This is especially important
// for the first connection to be sure settings are correct
const { lndConfig } = getState().lnd
await dispatch(setActiveWallet(lndConfig.id))
let walletId = lndConfig.id
// no wallet id means wallet is being connected to for the first time
// use `putWallet` to update DB and obtain `id`
if (!walletId) {
;({ id: walletId } = await dispatch(putWallet(lndConfig)))
}

await dispatch(setActiveWallet(walletId))
}

/**

0 comments on commit cd7c61b

Please sign in to comment.
You can’t perform that action at this time.