diff --git a/supernode/flosend.html b/supernode/flosend.html index f09112f..eaba112 100644 --- a/supernode/flosend.html +++ b/supernode/flosend.html @@ -3302,9 +3302,26 @@ buffer = buffer.concat(scriptBytes); } - buffer = buffer.concat(bitjs.numToBytes(parseInt(this.locktime), 4)); + buffer = buffer.concat(bitjs.numToBytes(parseInt(this.locktime),4)); flohex = ascii_to_hexa(this.floData); - return Crypto.util.bytesToHex(buffer) + flohex; // flochange -- Addition of floData in serialization + floDataCount = this.floData.length; + + //flochange -- creating unique data character count logic for floData. This string is prefixed before actual floData string in Raw Transaction + if (floDataCount <= 16) { + floDataCountString = floDataCount.toString(16); + floDataCountString = "0"+ floDataCountString; + } else if (floDataCount < 253) { + floDataCountString = floDataCount.toString(16); + } else if (floDataCount <= 1023) { + floDataCountAdjusted = (floDataCount - 253) + parseInt("0xfd00fd"); + floDataCountStringAdjusted = floDataCountAdjusted.toString(16); + floDataCountString = floDataCountStringAdjusted.substr(0,2)+ floDataCountStringAdjusted.substr(4,2)+ floDataCountStringAdjusted.substr(2,2); + } else { + floDataCountString = "Character Limit Exceeded"; + } + + + return Crypto.util.bytesToHex(buffer)+floDataCountString+flohex; // flochange -- Addition of floDataCountString and floData in serialization } @@ -3432,7 +3449,6 @@ })(); - //script.js // Actual Code Begins Here function createRawTransaction() { @@ -3457,39 +3473,13 @@ + + + + @@ -7950,13 +8120,12 @@ var RM_TRADE = new localbitcoinplusplus.trade; var RM_RPC = new localbitcoinplusplus.rpc; - // Test: fetch flo comment - RM_TRADE.floAddress = RM_WALLET.rm_flo_addr; - var fetch_configs = RM_TRADE.parse_flo_comments(function (floData) { - console.log(floData); - }); + //Test: fetch flo comment + // var rm_configs = RM_TRADE.fetch_configs(function(data) { + // console.log(data); + // }); - // Test: Trade functionality + // // Test: Trade functionality var trade_btn = document.createElement("button"); trade_btn.innerText = "Trade"; trade_btn.onclick = function () {