Lazy load flashbot tx checking

This commit is contained in:
Willian Mitsuda 2021-07-05 17:52:20 -03:00
parent 1b26e6be27
commit 754369578f
1 changed files with 5 additions and 7 deletions

View File

@ -69,6 +69,7 @@ const BlockTransactions: React.FC = () => {
};
})
.reverse();
setTxs(responses);
const internalChecks = await Promise.all(
responses.map(async (res) => {
@ -87,13 +88,10 @@ const BlockTransactions: React.FC = () => {
return false;
})
);
for (let i = 0; i < responses.length; i++) {
if (internalChecks[i]) {
responses[i].internalMinerInteraction = true;
}
}
setTxs(responses);
const processedResponses = responses.map((r, i): ProcessedTransaction => {
return { ...r, internalMinerInteraction: internalChecks[i] };
});
setTxs(processedResponses);
};
readBlock();
}, [blockNumber]);