Adding "mempool block" details. Work in progress!
This commit is contained in:
@@ -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]) {
|
||||
|
||||
Reference in New Issue
Block a user