From 23b6c84d1fe1771e5b43854ff5a8920d135d9b9d Mon Sep 17 00:00:00 2001 From: OutCast3k Date: Mon, 15 Dec 2014 14:38:39 +0000 Subject: [PATCH] another minor tweak/fix to the way that nLocktime works --- js/coin.js | 4 ++-- js/coinbin.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/coin.js b/js/coin.js index 719cd3b..ae88afb 100644 --- a/js/coin.js +++ b/js/coin.js @@ -373,7 +373,7 @@ var o = {}; o.outpoint = {'hash':txid, 'index':index}; o.script = coinjs.script(script||[]); - o.sequence = sequence || 4294967295; + o.sequence = (typeof sequence===undefined) ? 4294967295 : sequence; return this.ins.push(o); } @@ -892,7 +892,7 @@ } coinjs.numToBytes = function(num,bytes) { - if (bytes === undefined) bytes = 8; + if (typeof bytes === undefined) bytes = 8; if (bytes == 0) { return []; } else { diff --git a/js/coinbin.js b/js/coinbin.js index 2a96181..332c562 100644 --- a/js/coinbin.js +++ b/js/coinbin.js @@ -356,7 +356,7 @@ $(document).ready(function() { $.each($("#inputs .row"), function(i,o){ if($(".txId",o).val()!="" && $(".txIdN",o).val()!=""){ - var sequence = (tx.lock_time==0) ? 4294967295 : 0; + var sequence = ($("#nLockTime").val()=="0") ? 4294967295 : 0; tx.addinput($(".txId",o).val(), $(".txIdN",o).val(), $(".txIdScript",o).val(), sequence); } });