Skip to content

Commit

Permalink
Prevent wallet from listing unrelated transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
slaweet committed Feb 8, 2018
1 parent b8ea748 commit 968a0e8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/store/middlewares/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ import transactionTypes from '../../constants/transactionTypes';
const { lockDuration } = accountConfig;

const updateTransactions = (store, peers) => {
const filter = store.getState().transactions.filter;
const address = store.getState().transactions.address;
getTransactions({ activePeer: peers.data, address, limit: 25, filter })
.then(response => store.dispatch(transactionsUpdated({
confirmed: response.transactions,
count: parseInt(response.count, 10),
})));
const state = store.getState();
const { filter } = state.transactions;
const address = state.transactions.address ? state.transactions.address : state.account.address;
getTransactions({
activePeer: peers.data, address, limit: 25, filter,
}).then(response => store.dispatch(transactionsUpdated({
confirmed: response.transactions,
count: parseInt(response.count, 10),
})));
};

const hasRecentTransactions = txs => (
Expand Down

0 comments on commit 968a0e8

Please sign in to comment.