diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/index.html | 7 | ||||
-rw-r--r-- | src/js/index.js | 11 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/index.html b/src/index.html index e204095..905f9ea 100644 --- a/src/index.html +++ b/src/index.html | |||
@@ -409,6 +409,13 @@ | |||
409 | </label> | 409 | </label> |
410 | </div> | 410 | </div> |
411 | <div class="form-group"> | 411 | <div class="form-group"> |
412 | <div class="col-sm-2"></div> | ||
413 | <label class="col-sm-10"> | ||
414 | <input class="p2wpkh-nested-in-p2sh" type="checkbox"> | ||
415 | <span data-translate>Use SegWit addresses (ie P2WPKH Nested In P2SH)</span> | ||
416 | </label> | ||
417 | </div> | ||
418 | <div class="form-group"> | ||
412 | <label for="core-path" class="col-sm-2 control-label" data-translate>Bitcoin Core</label> | 419 | <label for="core-path" class="col-sm-2 control-label" data-translate>Bitcoin Core</label> |
413 | <div class="col-sm-10"> | 420 | <div class="col-sm-10"> |
414 | <p class="form-control no-border" data-translate-html> | 421 | <p class="form-control no-border" data-translate-html> |
diff --git a/src/js/index.js b/src/js/index.js index 80e6609..9bd77b9 100644 --- a/src/js/index.js +++ b/src/js/index.js | |||
@@ -73,6 +73,7 @@ | |||
73 | DOM.bip49change = $("#bip49 .change"); | 73 | DOM.bip49change = $("#bip49 .change"); |
74 | DOM.generatedStrength = $(".generate-container .strength"); | 74 | DOM.generatedStrength = $(".generate-container .strength"); |
75 | DOM.hardenedAddresses = $(".hardened-addresses"); | 75 | DOM.hardenedAddresses = $(".hardened-addresses"); |
76 | DOM.useP2wpkhNestedInP2sh = $(".p2wpkh-nested-in-p2sh"); | ||
76 | DOM.addresses = $(".addresses"); | 77 | DOM.addresses = $(".addresses"); |
77 | DOM.rowsToAdd = $(".rows-to-add"); | 78 | DOM.rowsToAdd = $(".rows-to-add"); |
78 | DOM.more = $(".more"); | 79 | DOM.more = $(".more"); |
@@ -109,6 +110,7 @@ | |||
109 | DOM.bip49change.on("input", calcForDerivationPath); | 110 | DOM.bip49change.on("input", calcForDerivationPath); |
110 | DOM.tab.on("shown.bs.tab", calcForDerivationPath); | 111 | DOM.tab.on("shown.bs.tab", calcForDerivationPath); |
111 | DOM.hardenedAddresses.on("change", calcForDerivationPath); | 112 | DOM.hardenedAddresses.on("change", calcForDerivationPath); |
113 | DOM.useP2wpkhNestedInP2sh.on("change", calcForDerivationPath); | ||
112 | DOM.indexToggle.on("click", toggleIndexes); | 114 | DOM.indexToggle.on("click", toggleIndexes); |
113 | DOM.addressToggle.on("click", toggleAddresses); | 115 | DOM.addressToggle.on("click", toggleAddresses); |
114 | DOM.publicKeyToggle.on("click", togglePublicKeys); | 116 | DOM.publicKeyToggle.on("click", togglePublicKeys); |
@@ -637,7 +639,7 @@ | |||
637 | var self = this; | 639 | var self = this; |
638 | this.shouldGenerate = true; | 640 | this.shouldGenerate = true; |
639 | var useHardenedAddresses = DOM.hardenedAddresses.prop("checked"); | 641 | var useHardenedAddresses = DOM.hardenedAddresses.prop("checked"); |
640 | var isP2wpkhNestedInP2sh = bip49TabSelected(); | 642 | var isP2wpkhNestedInP2sh = bip49TabSelected() || (bip32TabSelected() && useP2wpkhNestedInP2sh()); |
641 | var p2wpkhNestedInP2shAvailable = networkHasBip49(); | 643 | var p2wpkhNestedInP2shAvailable = networkHasBip49(); |
642 | 644 | ||
643 | function init() { | 645 | function init() { |
@@ -1164,6 +1166,10 @@ | |||
1164 | return DOM.bip32tab.hasClass("active"); | 1166 | return DOM.bip32tab.hasClass("active"); |
1165 | } | 1167 | } |
1166 | 1168 | ||
1169 | function useP2wpkhNestedInP2sh() { | ||
1170 | return DOM.useP2wpkhNestedInP2sh.prop("checked"); | ||
1171 | } | ||
1172 | |||
1167 | function networkHasBip49() { | 1173 | function networkHasBip49() { |
1168 | return networks[DOM.network.val()].p2wpkhNestedInP2shAvailable; | 1174 | return networks[DOM.network.val()].p2wpkhNestedInP2shAvailable; |
1169 | } | 1175 | } |
@@ -1180,11 +1186,14 @@ | |||
1180 | function showP2wpkhNestedInP2shAvailable() { | 1186 | function showP2wpkhNestedInP2shAvailable() { |
1181 | DOM.bip49unavailable.addClass("hidden"); | 1187 | DOM.bip49unavailable.addClass("hidden"); |
1182 | DOM.bip49available.removeClass("hidden"); | 1188 | DOM.bip49available.removeClass("hidden"); |
1189 | DOM.useP2wpkhNestedInP2sh.prop("disabled", false); | ||
1183 | } | 1190 | } |
1184 | 1191 | ||
1185 | function showP2wpkhNestedInP2shUnavailable() { | 1192 | function showP2wpkhNestedInP2shUnavailable() { |
1186 | DOM.bip49available.addClass("hidden"); | 1193 | DOM.bip49available.addClass("hidden"); |
1187 | DOM.bip49unavailable.removeClass("hidden"); | 1194 | DOM.bip49unavailable.removeClass("hidden"); |
1195 | DOM.useP2wpkhNestedInP2sh.prop("disabled", true); | ||
1196 | DOM.useP2wpkhNestedInP2sh.prop("checked", false); | ||
1188 | } | 1197 | } |
1189 | 1198 | ||
1190 | var networks = [ | 1199 | var networks = [ |