- DOM.useP2wpkhNestedInP2sh.prop("disabled", true);
- DOM.useP2wpkhNestedInP2sh.prop("checked", false);
+ DOM.bip84available.addClass("hidden");
+ DOM.bip84unavailable.removeClass("hidden");
+ DOM.bip141available.addClass("hidden");
+ DOM.bip141unavailable.removeClass("hidden");
+ }
+
+ function adjustNetworkForSegwit() {
+ // If segwit is selected the xpub/xprv prefixes need to be adjusted
+ // to avoid accidentally importing BIP49 xpub to BIP44 watch only
+ // wallet.
+ // See https://github.com/iancoleman/bip39/issues/125
+ var segwitNetworks = null;
+ // if a segwit network is alread selected, need to use base network to
+ // look up new parameters
+ if ("baseNetwork" in network) {
+ network = bitcoinjs.bitcoin.networks[network.baseNetwork];
+ }
+ // choose the right segwit params
+ if (p2wpkhSelected() && "p2wpkh" in network) {
+ network = network.p2wpkh;
+ }
+ else if (p2wpkhInP2shSelected() && "p2wpkhInP2sh" in network) {
+ network = network.p2wpkhInP2sh;
+ }