From ebde3064444b4a9a2a1d7c033f0297ee5f06c94c Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Wed, 16 Jan 2019 13:54:40 +0100 Subject: [PATCH] fix(lnd): handle seed generation error --- app/reducers/lnd.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/reducers/lnd.js b/app/reducers/lnd.js index 210c4313e91..69ea45fc52e 100644 --- a/app/reducers/lnd.js +++ b/app/reducers/lnd.js @@ -263,14 +263,18 @@ export const setUnlockWalletError = (event, unlockWalletError) => dispatch => { export const fetchSeed = () => async dispatch => { dispatch({ type: FETCH_SEED }) - await dispatch( - startLnd({ - id: `tmp`, - type: 'local', - chain: 'bitcoin', - network: 'testnet' - }) - ) + try { + await dispatch( + startLnd({ + id: `tmp`, + type: 'local', + chain: 'bitcoin', + network: 'testnet' + }) + ) + } catch (error) { + dispatch({ type: FETCH_SEED_ERROR, error }) + } } // Listener for when LND creates and sends us a generated seed