flo comment write and fetch functions complete in flosend.html

This commit is contained in:
Abhishek Sinha 2018-10-22 14:04:39 +05:30
parent dfb0297929
commit 6989c93717

View File

@ -19,8 +19,8 @@
<input type="text" id="prevTrxHash"> <input type="text" id="prevTrxHash">
<label>Index</label> <label>Index</label>
<input type="text" id="index"> <input type="text" id="index">
<label>Script</label> <label>ScriptPubKey</label>
<input type="text" id="script"> <input type="text" id="scriptPubKey">
<h2>Outputs</h2> <h2>Outputs</h2>
<label>Address</label> <label>Address</label>
@ -2980,14 +2980,14 @@
btrx.floData = ""; //flochange .. look at this btrx.floData = ""; //flochange .. look at this
btrx.addinput = function (txid, index, script, sequence) { btrx.addinput = function (txid, index, scriptPubKey, sequence) {
var o = {}; var o = {};
o.outpoint = { o.outpoint = {
'hash': txid, 'hash': txid,
'index': index 'index': index
}; };
//o.script = []; Signature and Public Key should be added after singning //o.script = []; Signature and Public Key should be added after singning
o.script = Crypto.util.hexToBytes(script); //push previous output pubkey script o.script = Crypto.util.hexToBytes(scriptPubKey); //push previous output pubkey script
o.sequence = sequence || ((btrx.locktime == 0) ? 4294967295 : 0); o.sequence = sequence || ((btrx.locktime == 0) ? 4294967295 : 0);
return this.inputs.push(o); return this.inputs.push(o);
} }
@ -3439,8 +3439,8 @@
var trx = bitjs.transaction(); var trx = bitjs.transaction();
var txid = document.getElementById("prevTrxHash").value; var txid = document.getElementById("prevTrxHash").value;
var index = document.getElementById("index").value; var index = document.getElementById("index").value;
var script = document.getElementById("script").value; var scriptPubKey = document.getElementById("scriptPubKey").value;
trx.addinput(txid, index, script); trx.addinput(txid, index, scriptPubKey);
var address = document.getElementById("address1").value; var address = document.getElementById("address1").value;
var value = document.getElementById("value1").value; var value = document.getElementById("value1").value;
trx.addoutput(address, value); trx.addoutput(address, value);