mirror of
https://github.com/mempool/mempool.git
synced 2025-03-15 12:20:28 +01:00
Merge pull request #5579 from mempool/natsoni/use-adjusted-time-avg
Use adjusted block time for difficulty and ETA calculation
This commit is contained in:
commit
734d5f2461
2 changed files with 3 additions and 3 deletions
|
@ -45,7 +45,7 @@
|
||||||
<div class="difficulty-stats">
|
<div class="difficulty-stats">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="card-text">
|
<div class="card-text">
|
||||||
~<app-time [time]="epochData.timeAvg / 1000" [fractionDigits]="1"></app-time>
|
~<app-time [time]="epochData.adjustedTimeAvg / 1000" [fractionDigits]="1"></app-time>
|
||||||
</div>
|
</div>
|
||||||
<div class="symbol" i18n="difficulty-box.average-block-time">Average block time</div>
|
<div class="symbol" i18n="difficulty-box.average-block-time">Average block time</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -55,7 +55,7 @@ export class EtaService {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
hashratePercentage: acceleratingHashrateFraction * 100,
|
hashratePercentage: acceleratingHashrateFraction * 100,
|
||||||
ETA: Date.now() + da.timeAvg * mempoolPosition.block,
|
ETA: Date.now() + da.adjustedTimeAvg * mempoolPosition.block,
|
||||||
acceleratedETA: this.calculateETAFromShares([
|
acceleratedETA: this.calculateETAFromShares([
|
||||||
{ block: mempoolPosition.block, hashrateShare: (1 - acceleratingHashrateFraction) },
|
{ block: mempoolPosition.block, hashrateShare: (1 - acceleratingHashrateFraction) },
|
||||||
{ block: 0, hashrateShare: acceleratingHashrateFraction },
|
{ block: 0, hashrateShare: acceleratingHashrateFraction },
|
||||||
|
@ -216,7 +216,7 @@ export class EtaService {
|
||||||
}
|
}
|
||||||
// at max depth, the transaction is guaranteed to be mined in the next block if it hasn't already
|
// at max depth, the transaction is guaranteed to be mined in the next block if it hasn't already
|
||||||
Q += ((max + 1) * (1-tailProb));
|
Q += ((max + 1) * (1-tailProb));
|
||||||
const eta = da.timeAvg * Q; // T x Q
|
const eta = da.adjustedTimeAvg * Q; // T x Q
|
||||||
|
|
||||||
return {
|
return {
|
||||||
now,
|
now,
|
||||||
|
|
Loading…
Add table
Reference in a new issue