1
0

qml: limit BIP39 cosigners script type to initial choice (bip39) or initial seed (electrum)

This commit is contained in:
Sander van Grieken
2023-05-15 16:19:48 +02:00
committed by accumulator
parent eba3282024
commit 8cd95f1f7f
4 changed files with 30 additions and 12 deletions

View File

@@ -129,19 +129,24 @@ WizardComponent {
property string scripttype: 'p2sh'
text: qsTr('legacy multisig (p2sh)')
visible: isMultisig
enabled: !cosigner || wizard_data['script_type'] == 'p2sh'
checked: cosigner ? wizard_data['script_type'] == 'p2sh' : false
}
RadioButton {
ButtonGroup.group: scripttypegroup
property string scripttype: 'p2wsh-p2sh'
text: qsTr('p2sh-segwit multisig (p2wsh-p2sh)')
visible: isMultisig
enabled: !cosigner || wizard_data['script_type'] == 'p2wsh-p2sh'
checked: cosigner ? wizard_data['script_type'] == 'p2wsh-p2sh' : false
}
RadioButton {
ButtonGroup.group: scripttypegroup
property string scripttype: 'p2wsh'
checked: isMultisig
text: qsTr('native segwit multisig (p2wsh)')
visible: isMultisig
enabled: !cosigner || wizard_data['script_type'] == 'p2wsh'
checked: cosigner ? wizard_data['script_type'] == 'p2wsh' : isMultisig
}
InfoTextArea {

View File

@@ -31,6 +31,15 @@ WizardComponent {
wizard_data['seed_type'] = bitcoin.seedType
wizard_data['seed_extend'] = extendcb.checked
wizard_data['seed_extra_words'] = extendcb.checked ? customwordstext.text : ''
// determine script type from electrum seed type
// (used to limit script type options for bip39 cosigners)
if (wizard_data['wallet_type'] == 'multisig' && seed_variant_cb.currentValue == 'electrum') {
wizard_data['script_type'] = {
'standard': 'p2sh',
'segwit': 'p2wsh'
}[bitcoin.seedType]
}
}
}