From d17b822e45255f52619b0766addc99286e671477 Mon Sep 17 00:00:00 2001 From: cyyber Date: Sun, 19 Nov 2017 23:09:51 +0530 Subject: [PATCH] Array index out of range --- js/coin.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/coin.js b/js/coin.js index a7eb84e3..601b24de 100644 --- a/js/coin.js +++ b/js/coin.js @@ -1381,10 +1381,10 @@ r.getInputValues = function() { var self = this; - for (var i = 0; i < self.ins.length; i++) { - var utxo_txid = self.ins[i].outpoint.hash; - var utxo_index = self.ins[i].outpoint.index; - var utxo_address = self.extractAddress(i); + for (var k = 0; k < self.ins.length; k++) { + var utxo_txid = self.ins[k].outpoint.hash; + var utxo_index = self.ins[k].outpoint.index; + var utxo_address = self.extractAddress(k); $.ajax ({ type: "GET", cache: false, @@ -1403,7 +1403,7 @@ for(var i in data){ if (utxo_txid == data[i].txid && utxo_index == data[i].vout) { - self.ins[i].value = new BigInteger('' + Math.round((data[i].amount*1) * 1e8), 10); + self.ins[k].value = new BigInteger('' + Math.round((data[i].amount*1) * 1e8), 10); } } } else {