Merge pull request #4903 from mempool/mononaut/bright-purple

Don't apply age tint to accelerated txs
This commit is contained in:
softsimon 2024-04-06 17:39:24 +09:00 committed by GitHub
commit 0f217bd753
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -133,6 +133,10 @@ export function ageColorFunction(
auditColors: { [status: string]: Color } = defaultAuditColors, auditColors: { [status: string]: Color } = defaultAuditColors,
relativeTime?: number, relativeTime?: number,
): Color { ): Color {
if (tx.acc || tx.status === 'accelerated') {
return auditColors.accelerated;
}
const color = defaultColorFunction(tx, colors, auditColors, relativeTime); const color = defaultColorFunction(tx, colors, auditColors, relativeTime);
const ageLevel = (!tx.time ? 0 : (0.8 * Math.tanh((1 / 15) * Math.log2((Math.max(1, 0.6 * ((relativeTime - tx.time) - 60))))))); const ageLevel = (!tx.time ? 0 : (0.8 * Math.tanh((1 / 15) * Math.log2((Math.max(1, 0.6 * ((relativeTime - tx.time) - 60)))))));