Fix missing bare multisig labels

This commit is contained in:
Vojtěch Strnad
2024-07-01 07:21:37 +02:00
parent 7ed35b955d
commit 1c89a1a44e
2 changed files with 31 additions and 3 deletions

View File

@@ -33,6 +33,8 @@ export class AddressLabelsComponent implements OnChanges {
this.handleAddress();
} else if (this.vin) {
this.handleVin();
} else if (this.vout) {
this.handleVout();
}
}
@@ -61,4 +63,14 @@ export class AddressLabelsComponent implements OnChanges {
}
}
}
handleVout() {
const address = new AddressTypeInfo(this.network || 'mainnet', this.vout.scriptpubkey_address, this.vout.scriptpubkey_type as AddressType, undefined, this.vout);
if (address?.scripts.size) {
const script = address?.scripts.values().next().value;
if (script.template?.label) {
this.label = script.template.label;
}
}
}
}