Display P2PK instead of OP_RETURN

fixes #161
This commit is contained in:
softsimon 2020-11-16 16:21:37 +07:00
parent d9803e3f3d
commit 76238f5943
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
2 changed files with 8 additions and 2 deletions

View File

@ -128,7 +128,10 @@
</a>
</ng-template>
<ng-template #defaultscriptpubkey_type>
<a placement="bottom" [ngbTooltip]="vout.scriptpubkey | hex2ascii">{{ vout.scriptpubkey_type | scriptpubkeyType }}</a>&nbsp;<span class="badge badge-secondary scriptmessage">{{ vout.scriptpubkey_asm | hex2ascii }}</span>
<ng-template [ngIf]="vout.scriptpubkey_type === 'op_return'" [ngIfElse]="otherPubkeyType">
<a placement="bottom" [ngbTooltip]="vout.scriptpubkey | hex2ascii">OP_RETURN</a>&nbsp;<span class="badge badge-secondary scriptmessage">{{ vout.scriptpubkey_asm | hex2ascii }}</span>
</ng-template>
<ng-template #otherPubkeyType>{{ vout.scriptpubkey_type | scriptpubkeyType }}</ng-template>
</ng-template>
</ng-template>
</td>

View File

@ -9,9 +9,12 @@ export class ScriptpubkeyTypePipe implements PipeTransform {
switch (value) {
case 'fee':
return 'Transaction fee';
case 'p2pk':
return 'P2PK';
case 'op_return':
return 'OP_RETURN';
default:
return 'OP_RETURN';
return value.toUpperCase();
}
}