From bef19169d80c303a50d33126771e5e32d3f57da6 Mon Sep 17 00:00:00 2001 From: Sai Raj <39055732+sairajzero@users.noreply.github.com> Date: Sat, 8 Jun 2019 11:51:47 +0530 Subject: [PATCH] fix bug : use only confirmed utxos --- FLO_torrentUploader.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/FLO_torrentUploader.html b/FLO_torrentUploader.html index db830a2..2e86a47 100644 --- a/FLO_torrentUploader.html +++ b/FLO_torrentUploader.html @@ -417,8 +417,10 @@ function splitUTXOs(sender,num,wif){ var splitAmt = sendAmt + fee; var TotalAmt = splitAmt*(num+1); for(var x = utxos.length-1; (x >= 0) && (utxoAmt < TotalAmt+splitfee); x--){ + if(utxos[x].confirmations){ trx.addinput(utxos[x].txid, utxos[x].vout, utxos[x].scriptPubKey) utxoAmt += utxos[x].amount; + } } if(utxoAmt < TotalAmt+splitfee){ alert("Insufficient balance!"); @@ -465,8 +467,10 @@ function refreshUTXOs(){ var response = ajax("GET",`api/addr/${floID}/utxo`); var utxos = JSON.parse(response); for(var x = utxos.length-1; (x >= 0); x--){ + if(utxos[x].confirmations){ trx.addinput(utxos[x].txid, utxos[x].vout, utxos[x].scriptPubKey) utxoAmt += utxos[x].amount; + } } if(utxoAmt <= refreshfee){ alert("Insufficient Balance!");