Adding "mempool block" details. Work in progress!

This commit is contained in:
softsimon
2020-03-17 21:53:20 +07:00
parent 3e6f382c4d
commit 72658c19f6
18 changed files with 260 additions and 9 deletions

View File

@@ -20,6 +20,7 @@ export class MempoolBlocksComponent implements OnInit, OnChanges, OnDestroy {
rightPosition = 0;
@Input() txFeePerVSize: number;
@Input() markIndex: number;
constructor(
private stateService: StateService,
@@ -42,7 +43,6 @@ export class MempoolBlocksComponent implements OnInit, OnChanges, OnDestroy {
}
}
ngOnChanges() {
this.calculateTransactionPosition();
}
@@ -91,13 +91,18 @@ export class MempoolBlocksComponent implements OnInit, OnChanges, OnDestroy {
}
calculateTransactionPosition() {
if (!this.txFeePerVSize || !this.mempoolBlocks) {
if ((!this.txFeePerVSize && this.markIndex === -1) || !this.mempoolBlocks) {
this.arrowVisible = false;
return;
}
this.arrowVisible = true;
if (this.markIndex > -1) {
this.rightPosition = this.markIndex * (this.blockWidth + this.blockPadding) + 0.5 * this.blockWidth;
return;
}
for (const block of this.mempoolBlocks) {
for (let i = 0; i < block.feeRange.length - 1; i++) {
if (this.txFeePerVSize < block.feeRange[i + 1] && this.txFeePerVSize >= block.feeRange[i]) {