Merge 2cd9465de9d031eb553304e70a1c281071588730 into cda4559cfd5948dbb18dc078c48a3e62121218e5

This commit is contained in:
Will Caine 2022-01-27 09:34:43 -08:00 committed by GitHub
commit 474cfeae3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -1280,6 +1280,10 @@
</span>
</div>
</div>
<div class="col-md-12">
<label for="signPrivateKeyPassphrase">Passphrase (optional)</label>
<input id="signPrivateKeyPassphrase" type="password" class="form-control" value="">
</div>
</div>
<br>

View File

@ -1682,7 +1682,18 @@ $(document).ready(function() {
$("#signBtn").click(function(){
var wifkey = $("#signPrivateKey");
var passphrase = $("#signPrivateKeyPassphrase");
var script = $("#signTransaction");
if(passphrase.val()!=""){
var decrypted = CryptoJS.AES.decrypt(wifkey.val(), passphrase.val()).toString(CryptoJS.enc.Utf8);
if(coinjs.addressDecode(decrypted)){
$(passphrase).parent().removeClass('has-error');
wifkey.val(decrypted);
} else {
$(passphrase).parent().addClass('has-error');
}
}
if(coinjs.addressDecode(wifkey.val())){
$(wifkey).parent().removeClass('has-error');