From 194df37d56a47ec9f7b16c65e77fffbfca296d8c Mon Sep 17 00:00:00 2001 From: OutCast3k Date: Fri, 28 Dec 2018 23:33:42 +0000 Subject: [PATCH] bug fix for time locked addresses. transactions not being built correctly (no loss of funds!!!!) --- js/coinbin.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/coinbin.js b/js/coinbin.js index cb279ee..df096c8 100644 --- a/js/coinbin.js +++ b/js/coinbin.js @@ -854,7 +854,7 @@ $(document).ready(function() { /* redeem from button code */ $("#redeemFromBtn").click(function(){ - var redeem = redeemingFrom($("#redeemFrom").val()); + var redeem = redeemingFrom($("#redeemFrom").val()); $("#redeemFromStatus, #redeemFromAddress").addClass('hidden'); @@ -888,8 +888,9 @@ $(document).ready(function() { if($("#redeemFromStatus").hasClass("hidden")) { // An ethical dilemma: Should we automatically set nLockTime? - if(redeem.from == 'redeemScript' && redeem.decodedRs.type == "hodl__") { - $("#nLockTime").val(redeem.decodedRs.checklocktimeverify); + console.log(redeem); + if(redeem.from == 'redeemScript' && redeem.decodescript.type == "hodl__") { + $("#nLockTime").val(redeem.decodescript.checklocktimeverify); } else { $("#nLockTime").val(0); } @@ -925,7 +926,9 @@ $(document).ready(function() { r.addr = decodeRs['address']; r.from = 'redeemScript'; r.decodedRs = decodeRs.redeemscript; + r.type = decodeRs['type']; r.redeemscript = true; + r.decodescript = decodeRs; } else { // something else r.addr = ''; r.from = 'other';