Store hex in coinbase raw - Improve scripsig parsing

This commit is contained in:
nymkappa
2022-03-16 12:10:18 +01:00
parent acaa6c6e45
commit fdea74db0a
6 changed files with 8 additions and 23 deletions

View File

@@ -30,7 +30,7 @@
onError="this.src = './resources/mining-pools/default.svg'">
<span class="pool-name">{{ block.extras.pool.name }}</span>
</a>
<span class="tooltiptext">{{ block.extras.coinbaseRaw }}</span>
<span class="tooltiptext">{{ block.extras.coinbaseRaw | hex2ascii }}</span>
</div>
</td>
<td class="timestamp" *ngIf="!widget">

View File

@@ -19,7 +19,7 @@ export class Hex2asciiPipe implements PipeTransform {
for (let i = 0; i < hex.length; i += 2) {
bytes.push(parseInt(hex.substr(i, 2), 16));
}
return new TextDecoder('utf8').decode(Uint8Array.from(bytes));
return new TextDecoder('utf8').decode(Uint8Array.from(bytes)).replace(/\uFFFD/g, '').replace(/\\0/g, '');
}
}