few minor changes, plus the wallet now enables rbf by default

This commit is contained in:
OutCast3k
2018-01-06 16:11:20 +00:00
parent ed7d5d6411
commit c3b1a47199
4 changed files with 25 additions and 9 deletions
+3 -2
View File
@@ -882,7 +882,7 @@
}
/* add unspent to transaction */
r.addUnspent = function(address, callback, script, segwit){
r.addUnspent = function(address, callback, script, segwit, sequence){
var self = this;
this.listUnspent(address, function(data){
var s = coinjs.script();
@@ -919,7 +919,8 @@
scr = Crypto.util.bytesToHex(s.buffer);
}
self.addinput(txhash, n, scr);
var seq = sequence || false;
self.addinput(txhash, n, scr, seq);
value += u.getElementsByTagName("value")[0].childNodes[0].nodeValue*1;
total++;
}
+9 -1
View File
@@ -146,6 +146,11 @@ $(document).ready(function() {
script = sw.redeemscript;
}
var sequence = false;
if($("#walletRBF").is(":checked")){
sequence = 0xffffffff-2;
}
tx.addUnspent($("#walletAddress").html(), function(data){
var dvalue = (data.value/100000000).toFixed(8) * 1;
@@ -186,7 +191,7 @@ $(document).ready(function() {
$("#walletLoader").addClass("hidden");
}, script, script);
}, script, script, sequence);
});
$("#walletSendBtn").click(function(){
@@ -1471,6 +1476,9 @@ $(document).ready(function() {
if(pubkey.length==66 || pubkey.length==130){
try {
$("#verifyPubKey .address").val(coinjs.pubkey2address(pubkey));
var sw = coinjs.segwitAddress(pubkey);
$("#verifyPubKey .addressSegWit").val(sw.address);
$("#verifyPubKey .addressSegWitRedeemScript").val(sw.redeemscript);
$("#verifyPubKey").removeClass("hidden");
$(".verifyLink").attr('href','?verify='+$("#verifyScript").val());
return true;