Strip non-alphanumeric chars from miner names

This commit is contained in:
BitcoinMechanic
2024-09-23 12:36:10 -07:00
parent 4220f99477
commit e6dbde952e
2 changed files with 3 additions and 11 deletions

View File

@@ -283,6 +283,7 @@ export class BlockchainBlocksComponent implements OnInit, OnChanges, OnDestroy {
block.extras.maxFee = this.getMaxBlockFee(block);
if (block.extras.pool?.minerNames) {
block.extras.pool.minerNames = block.extras.pool.minerNames.map((name) => {
name = name.replace(/[^a-zA-Z0-9 ]/g, '');
if (name.length > 16) {
return name.slice(0, 16) + '…';
}