Merge branch 'master' into full_featured

This commit is contained in:
Kiyomichi Kosaka 2021-04-05 20:20:13 +02:00
commit 3b1e44e4b4
2 changed files with 14 additions and 6 deletions

View File

@ -1215,7 +1215,7 @@
<div id="hdpath" class="hidden" style="margin-top:4px">
<span class="input-group">
<input type="text" class="form-control" value="m/0/1"> <br>
<input type="text" class="form-control" value="m/0/1" title="WARNING: see #settings page when using hardened paths!"> <br>
<span class="input-group-addon"> / </span>
</span>
</div>
@ -1487,8 +1487,8 @@
<b>HD wallet hardened path derivation</b>: <br>
<p class="text-muted">The path derivation for hardened paths was calculated wrong in earlier versions of coinb.in. Please select the old path derivation to recover HD wallet keys generated with older version of coinb.in.</p>
<select class="form-control" id="coinjs_derivation">
<option value="bip32_derivation">BIP32 derivation</option>
<option value="coinbin_broken">Old coinb.in derivation</option>
<option value="bip32_derivation">BIP32 compliant derivation</option>
<option value="coinbin_broken">Old (broken) coinb.in path derivation</option>
</select>
</div>
</div>

View File

@ -1704,15 +1704,23 @@ $(document).ready(function() {
function deriveHDaddress() {
var hd = coinjs.hd($("#verifyHDaddress .hdKey").html());
var index_start = $("#verifyHDaddress .derivation_index_start").val()*1;
var index_end = $("#verifyHDaddress .derivation_index_end").val()*1;
var index_start = $("#verifyHDaddress .derivation_index_start").val();
if ((index_start.length > 1) && (index_start[index_start.length - 1] == '\'')) {
var use_private_index = '\'';
index_start = index_start.replace(/[']/, "") * 1;
} else {
var use_private_index = '';
index_start = index_start.replace(/[']/, "") * 1;
}
var index_end = $("#verifyHDaddress .derivation_index_end").val().replace(/[']/, "") * 1;
$("#verifyHDaddress .derivation_index_end").val(index_end + use_private_index);
var html = '';
$("#verifyHDaddress .derived_data table tbody").html("");
for(var i=index_start;i<=index_end;i++){
if($("#hdpathtype option:selected").val()=='simple'){
var derived = hd.derive(i);
} else {
var derived = hd.derive_path(($("#hdpath input").val().replace(/\/+$/, ""))+'/'+i);
var derived = hd.derive_path(($("#hdpath input").val().replace(/\/+$/, ""))+'/'+i+use_private_index);
}
html += '<tr>';
html += '<td>'+i+'</td>';