1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

sort poll by blockNo

This commit is contained in:
alexcos20 2020-10-13 05:26:47 -07:00
parent 5c2cef618e
commit 161d363e3c

View File

@ -782,6 +782,7 @@ export class OceanPool extends Pool {
fromBlock: 0,
toBlock: 'latest'
})
events.sort((a, b) => (a.blockNumber > b.blockNumber ? 1 : -1))
for (let i = 0; i < events.length; i++) {
const constituents = await super.getCurrentTokens(events[i].returnValues[0])
if (constituents.includes(dtAddress)) result.push(events[i].returnValues[0])