* Filter tokens logs from current block, not genesis * Fix linting
This commit is contained in:
parent
fdc781dbfd
commit
33a553726a
@ -144,13 +144,16 @@ export function updateTokensFilter (_addresses, _tokens, options = {}) {
|
||||
promises.push(api.eth.uninstallFilter(tokensFilter.filterToId));
|
||||
}
|
||||
|
||||
const promise = Promise.all(promises);
|
||||
|
||||
Promise
|
||||
.all([
|
||||
api.eth.blockNumber()
|
||||
].concat(promises))
|
||||
.then(([ block ]) => {
|
||||
const topicsFrom = [ TRANSFER_SIGNATURE, addresses, null ];
|
||||
const topicsTo = [ TRANSFER_SIGNATURE, null, addresses ];
|
||||
|
||||
const filterOptions = {
|
||||
fromBlock: 0,
|
||||
fromBlock: block,
|
||||
toBlock: 'pending',
|
||||
address: tokenAddresses
|
||||
};
|
||||
@ -170,8 +173,8 @@ export function updateTokensFilter (_addresses, _tokens, options = {}) {
|
||||
api.eth.newFilter(optionsTo)
|
||||
]);
|
||||
|
||||
promise
|
||||
.then(() => newFilters)
|
||||
return newFilters;
|
||||
})
|
||||
.then(([ filterFromId, filterToId ]) => {
|
||||
const nextTokensFilter = {
|
||||
filterFromId, filterToId,
|
||||
|
Loading…
Reference in New Issue
Block a user