mirror of
https://github.com/mempool/mempool.git
synced 2025-04-08 03:48:31 +02:00
Accelerator dashboard fix success criteria
This commit is contained in:
parent
5a55ba2d28
commit
f071d5e76a
@ -72,7 +72,7 @@ export class AccelerationFeesGraphComponent implements OnInit {
|
||||
this.hrStatsObservable$ = this.apiService.getAccelerationHistory$('24h').pipe(
|
||||
map((accelerations) => {
|
||||
return {
|
||||
avgFeeDelta: accelerations.filter(acc => acc.status === 'mined' || acc.status === 'completed').reduce((total, acc) => total + acc.feeDelta, 0) / accelerations.length
|
||||
avgFeeDelta: accelerations.filter(acc => acc.status === 'completed').reduce((total, acc) => total + acc.feeDelta, 0) / accelerations.length
|
||||
};
|
||||
})
|
||||
);
|
||||
@ -87,7 +87,7 @@ export class AccelerationFeesGraphComponent implements OnInit {
|
||||
}),
|
||||
map(([accelerations, blockFeesResponse]) => {
|
||||
return {
|
||||
avgFeeDelta: accelerations.filter(acc => acc.status === 'mined' || acc.status === 'completed').reduce((total, acc) => total + acc.feeDelta, 0) / accelerations.length
|
||||
avgFeeDelta: accelerations.filter(acc => acc.status === 'completed').reduce((total, acc) => total + acc.feeDelta, 0) / accelerations.length
|
||||
};
|
||||
}),
|
||||
);
|
||||
@ -132,7 +132,7 @@ export class AccelerationFeesGraphComponent implements OnInit {
|
||||
const blockAccelerations = {};
|
||||
|
||||
for (const acceleration of accelerations) {
|
||||
if (acceleration.status === 'mined' || acceleration.status === 'completed') {
|
||||
if (acceleration.status === 'completed') {
|
||||
if (!blockAccelerations[acceleration.blockHeight]) {
|
||||
blockAccelerations[acceleration.blockHeight] = [];
|
||||
}
|
||||
|
@ -54,12 +54,16 @@ export class AcceleratorDashboardComponent implements OnInit {
|
||||
)
|
||||
]).pipe(
|
||||
switchMap(([blocks, accelerations]) => {
|
||||
const blockMap = {};
|
||||
for (const block of blocks) {
|
||||
blockMap[block.id] = block;
|
||||
}
|
||||
const accelerationsByBlock: { [ hash: string ]: Acceleration[] } = {};
|
||||
for (const acceleration of accelerations) {
|
||||
if (['mined', 'completed'].includes(acceleration.status) && !accelerationsByBlock[acceleration.blockHash]) {
|
||||
accelerationsByBlock[acceleration.blockHash] = [];
|
||||
}
|
||||
if (['mined', 'completed'].includes(acceleration.status)) {
|
||||
if (['mined', 'completed'].includes(acceleration.status) && acceleration.pools.includes(blockMap[acceleration.blockHash]?.extras.pool.id)) {
|
||||
if (!accelerationsByBlock[acceleration.blockHash]) {
|
||||
accelerationsByBlock[acceleration.blockHash] = [];
|
||||
}
|
||||
accelerationsByBlock[acceleration.blockHash].push(acceleration);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user