Skip to content

Commit

Permalink
use script value
Browse files Browse the repository at this point in the history
  • Loading branch information
dabura667 committed Apr 19, 2020
1 parent d1227fa commit b35693d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions js/coinbin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1804,20 +1804,21 @@ $(document).ready(function() {
$("#signBtn").click(function(){
var wifkey = $("#signPrivateKey");
var script = $("#signTransaction");
var scriptVal = script.val();

if(coinjs.addressDecode(wifkey.val())){
$(wifkey).parent().removeClass('has-error');
} else {
$(wifkey).parent().addClass('has-error');
}

if(script.indexOf("|") >= 0){
var splitScript = script.split("|");
if(scriptVal.indexOf("|") >= 0){
var splitScript = scriptVal.split("|");
var valuesBufferHex = splitScript[1];
script = splitScript[0];
scriptVal = splitScript[0];
}

if((script.val()).match(/^[a-f0-9]+$/ig)){
if(scriptVal.match(/^[a-f0-9]+$/ig)){
$(script).parent().removeClass('has-error');
} else {
$(script).parent().addClass('has-error');
Expand All @@ -1827,7 +1828,7 @@ $(document).ready(function() {
$("#signedDataError").addClass('hidden');
try {
var tx = coinjs.transaction();
var t = tx.deserialize(script.val());
var t = tx.deserialize(scriptVal);

if (valuesBufferHex) {
var valuesHex = valuesBufferHex;
Expand Down

0 comments on commit b35693d

Please sign in to comment.