From cdee027c013597d0f7410d7a618c70724638fd8f Mon Sep 17 00:00:00 2001 From: OutCast3k Date: Mon, 15 Dec 2014 15:11:09 +0000 Subject: [PATCH] couple more tweaks to the way locktime vars are passed around --- js/coin.js | 4 ++-- js/coinbin.js | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/js/coin.js b/js/coin.js index ae88afb..95e36e0 100644 --- a/js/coin.js +++ b/js/coin.js @@ -369,11 +369,11 @@ r.block = null; /* add an input to a transaction */ - r.addinput = function(txid, index, script, sequence){ + r.addinput = function(txid, index, script){ var o = {}; o.outpoint = {'hash':txid, 'index':index}; o.script = coinjs.script(script||[]); - o.sequence = (typeof sequence===undefined) ? 4294967295 : sequence; + o.sequence = (r.lock_time==0) ? 4294967295 : 0; return this.ins.push(o); } diff --git a/js/coinbin.js b/js/coinbin.js index 332c562..d615019 100644 --- a/js/coinbin.js +++ b/js/coinbin.js @@ -356,8 +356,7 @@ $(document).ready(function() { $.each($("#inputs .row"), function(i,o){ if($(".txId",o).val()!="" && $(".txIdN",o).val()!=""){ - var sequence = ($("#nLockTime").val()=="0") ? 4294967295 : 0; - tx.addinput($(".txId",o).val(), $(".txIdN",o).val(), $(".txIdScript",o).val(), sequence); + tx.addinput($(".txId",o).val(), $(".txIdN",o).val(), $(".txIdScript",o).val()); } });