Updated scriptcode creator
This commit is contained in:
parent
eb3513a23f
commit
92c15c67a4
16
lib_btc.js
16
lib_btc.js
@ -2685,11 +2685,17 @@
|
|||||||
return t5;
|
return t5;
|
||||||
}
|
}
|
||||||
|
|
||||||
coinjs.scriptcodeCreatorBasic = function (redeemscript){
|
coinjs.scriptcodeCreatorBasic = function (scriptpubkey){
|
||||||
var t1,t2;
|
var t1,t2,t3,t4;
|
||||||
if (redeemscript.substr(0,4) == "0014"){
|
if (scriptpubkey.substr(0,4) == "0014"){
|
||||||
t1 = redeemscript.slice(2);
|
//Scriptpubkey case
|
||||||
t2 = "1976a9" + t1 + "88ac"; }
|
t1 = scriptpubkey.slice(2);
|
||||||
|
t2 = "1976a9" + t1 + "88ac"; } else {
|
||||||
|
//Redeemscript case
|
||||||
|
t3 = (scriptpubkey.length)/2;
|
||||||
|
t4 = t3.toString(16);
|
||||||
|
t2 = t4 + scriptpubkey;
|
||||||
|
}
|
||||||
return t2;
|
return t2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user