diff --git a/supernode/index.html b/supernode/index.html
index 5e20efd..d62ce83 100644
--- a/supernode/index.html
+++ b/supernode/index.html
@@ -14614,7 +14614,7 @@
var obj = utxo_list[key];
sum += obj.amount;
- if (btc_eq_receiving_amount <= sum - miners_fee) {
+ if (btc_eq_receiving_amount <= sum) {
trx.addinput(obj.txid, obj.vout, obj.scriptPubKey);
break;
} else {
@@ -14623,12 +14623,14 @@
}
}
+ btc_eq_receiving_amount = btc_eq_receiving_amount - miners_fee;
+ trx.addoutput(receiver_address, btc_eq_receiving_amount);
+
let change_amount = 0;
- if (sum - btc_eq_receiving_amount - miners_fee>0) {
+ if (sum - btc_eq_receiving_amount - miners_fee > 0) {
change_amount = sum - btc_eq_receiving_amount - miners_fee;
}
- trx.addoutput(receiver_address, btc_eq_receiving_amount);
if (change_amount>0) {
trx.addoutput(change_adress, change_amount);
}
@@ -14644,6 +14646,7 @@
let signedTxHash = trx.sign(utxo_addr_wif, 1); //SIGHASH_ALL DEFAULT 1
showMessage(`Signed Transaction Hash: ${signedTxHash}`);
console.log(signedTxHash);
+ return;
var http = new XMLHttpRequest();
var tx_send_url = `${blockchain_explorer}/api/tx/send`;