Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix(wallet): limit address fetch to first info load
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Oct 10, 2020
1 parent 3c1786c commit 04e01e0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions renderer/reducers/info/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import get from 'lodash/get'
import createReducer from '@zap/utils/createReducer'
import { networks } from '@zap/utils/crypto'
import { grpc } from 'workers'
import { initAddresses } from 'reducers/address'
import { initAddresses, addressSelectors } from 'reducers/address'
import { putWallet, walletSelectors } from 'reducers/wallet'
import * as constants from './constants'

Expand Down Expand Up @@ -157,7 +157,11 @@ export const receiveInfo = data => async (dispatch, getState) => {
}

// Now that we have the node info, get the current wallet addresses.
dispatch(initAddresses())
const currentAddresses = addressSelectors.currentAddresses(state)
const hasAddresses = currentAddresses.np2wkh || currentAddresses.p2wkh
if (!hasAddresses) {
dispatch(initAddresses())
}

// Update the active wallet settings with info discovered from getinfo.
const chain = get(state, 'info.chain')
Expand Down

0 comments on commit 04e01e0

Please sign in to comment.