REF: better support of coldcard's incorrect 'p2sh-p2wsh'

This commit is contained in:
Overtorment 2021-01-31 19:00:42 +00:00
parent b2b12e5191
commit 9b87901f03
3 changed files with 6 additions and 1 deletions

View File

@ -606,6 +606,7 @@ export class MultisigHDWallet extends AbstractHDElectrumWallet {
this.setLegacy();
break;
case MultisigHDWallet.FORMAT_P2SH_P2WSH:
case MultisigHDWallet.FORMAT_P2SH_P2WSH_ALT:
this.setWrappedSegwit();
break;
default:

View File

@ -71,7 +71,7 @@ const WalletsAddMultisig = () => {
const isP2wsh = () => format === MultisigHDWallet.FORMAT_P2WSH;
const isP2shP2wsh = () => format === MultisigHDWallet.FORMAT_P2SH_P2WSH;
const isP2shP2wsh = () => format === MultisigHDWallet.FORMAT_P2SH_P2WSH || format === MultisigHDWallet.FORMAT_P2SH_P2WSH_ALT;
const isP2sh = () => format === MultisigHDWallet.FORMAT_P2SH;

View File

@ -152,6 +152,7 @@ const WalletsAddMultisigStep2 = () => {
w.setDerivationPath(MultisigHDWallet.PATH_NATIVE_SEGWIT);
break;
case MultisigHDWallet.FORMAT_P2SH_P2WSH:
case MultisigHDWallet.FORMAT_P2SH_P2WSH_ALT:
w.setWrappedSegwit();
w.setDerivationPath(MultisigHDWallet.PATH_WRAPPED_SEGWIT);
break;
@ -206,6 +207,7 @@ const WalletsAddMultisigStep2 = () => {
path = MultisigHDWallet.PATH_NATIVE_SEGWIT;
break;
case MultisigHDWallet.FORMAT_P2SH_P2WSH:
case MultisigHDWallet.FORMAT_P2SH_P2WSH_ALT:
path = MultisigHDWallet.PATH_WRAPPED_SEGWIT;
break;
case MultisigHDWallet.FORMAT_P2SH:
@ -348,6 +350,7 @@ const WalletsAddMultisigStep2 = () => {
}
break;
case MultisigHDWallet.FORMAT_P2SH_P2WSH:
case MultisigHDWallet.FORMAT_P2SH_P2WSH_ALT:
if (cc.getPath().startsWith('m/48') && cc.getPath().endsWith("/1'")) {
// found it
cosigner = cc;
@ -379,6 +382,7 @@ const WalletsAddMultisigStep2 = () => {
}
break;
case MultisigHDWallet.FORMAT_P2SH_P2WSH:
case MultisigHDWallet.FORMAT_P2SH_P2WSH_ALT:
if (cosigner.getPath().startsWith('m/48') && cosigner.getPath().endsWith("/1'")) {
correctFormat = true;
}