Merge pull request #2601 from mononaut/fix-tx-marker

Fix transaction marker boundary condition
This commit is contained in:
wiz 2022-10-09 02:23:01 +09:00 committed by GitHub
commit bede502f2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -287,11 +287,12 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
this.arrowVisible = true; this.arrowVisible = true;
for (const block of this.mempoolBlocks) { let found = false;
for (let i = 0; i < block.feeRange.length - 1; i++) { for (let txInBlockIndex = 0; txInBlockIndex < this.mempoolBlocks.length && !found; txInBlockIndex++) {
const block = this.mempoolBlocks[txInBlockIndex];
for (let i = 0; i < block.feeRange.length - 1 && !found; i++) {
if (this.txFeePerVSize < block.feeRange[i + 1] && this.txFeePerVSize >= block.feeRange[i]) { if (this.txFeePerVSize < block.feeRange[i + 1] && this.txFeePerVSize >= block.feeRange[i]) {
const txInBlockIndex = this.mempoolBlocks.indexOf(block); const feeRangeIndex = i;
const feeRangeIndex = block.feeRange.findIndex((val, index) => this.txFeePerVSize < block.feeRange[index + 1]);
const feeRangeChunkSize = 1 / (block.feeRange.length - 1); const feeRangeChunkSize = 1 / (block.feeRange.length - 1);
const txFee = this.txFeePerVSize - block.feeRange[i]; const txFee = this.txFeePerVSize - block.feeRange[i];
@ -306,9 +307,13 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
+ ((1 - feePosition) * blockedFilledPercentage * this.blockWidth); + ((1 - feePosition) * blockedFilledPercentage * this.blockWidth);
this.rightPosition = arrowRightPosition; this.rightPosition = arrowRightPosition;
break; found = true;
} }
} }
if (this.txFeePerVSize >= block.feeRange[block.feeRange.length - 1]) {
this.rightPosition = txInBlockIndex * (this.blockWidth + this.blockPadding);
found = true;
}
} }
} }