Fix transaction ETA calculation

This commit is contained in:
Mononaut 2023-05-03 10:02:03 -06:00
parent 2f0d4d6068
commit 3f49944c05
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E

View File

@ -416,13 +416,15 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
const txFeePerVSize =
this.tx.effectiveFeePerVsize || this.tx.fee / (this.tx.weight / 4);
let found = false;
for (const block of mempoolBlocks) {
for (let i = 0; i < block.feeRange.length - 1; i++) {
for (let i = 0; i < block.feeRange.length - 1 && !found; i++) {
if (
txFeePerVSize <= block.feeRange[i + 1] &&
txFeePerVSize >= block.feeRange[i]
) {
this.txInBlockIndex = mempoolBlocks.indexOf(block);
found = true;
}
}
}