Announce difficulty locked in on last block of epoch

This commit is contained in:
Mononaut 2023-05-04 14:16:09 -04:00
parent 49529627f8
commit f0f4f8f920
No known key found for this signature in database
GPG Key ID: A3F058E41374C04E
3 changed files with 15 additions and 0 deletions

View File

@ -33,6 +33,7 @@
repeatCount="indefinite"/>
</rect>
</svg>
<span *ngIf="lockedIn" class="lock-in-msg" i18n="difficulty-box.adjustment-locked-in">Difficulty adjustment locked in</span>
</div>
<div class="difficulty-stats">
<div class="item">

View File

@ -172,6 +172,18 @@
width: 100%;
height: 22px;
margin-bottom: 12px;
position: relative;
.lock-in-msg {
position: absolute;
left: 0;
right: 0;
top: 0;
font-size: 12px;
line-height: 22px;
width: 100%;
text-align: center;
}
}
.epoch-blocks {

View File

@ -54,6 +54,7 @@ export class DifficultyComponent implements OnInit {
expectedHeight: number;
expectedIndex: number;
difference: number;
lockedIn: boolean = false;
shapes: DiffShape[];
tooltipPosition = { x: 0, y: 0 };
@ -104,6 +105,7 @@ export class DifficultyComponent implements OnInit {
this.currentIndex = this.currentHeight - this.epochStart;
this.expectedIndex = Math.min(this.expectedHeight - this.epochStart, 2016) - 1;
this.difference = this.currentIndex - this.expectedIndex;
this.lockedIn = this.currentIndex === 2015;
this.shapes = [];
this.shapes = this.shapes.concat(this.blocksToShapes(