started code to sync nodes

This commit is contained in:
Abhishek Sinha 2018-11-05 14:09:15 +05:30
parent 13a6d7e76a
commit a0864b2409

View File

@ -7190,8 +7190,7 @@
var localbitcoinplusplus = { var localbitcoinplusplus = {
wallets: {}, wallets: {},
trade: {}, trade: {},
rpc: {}, rpc: {}
rm_configs: {}
}; };
Object.defineProperty(localbitcoinplusplus, 'flocha', { Object.defineProperty(localbitcoinplusplus, 'flocha', {
@ -7662,6 +7661,19 @@
}); });
} }
} }
localbitcoinplusplus.rm_configs = {
networkSettings: function() {
this.myNodeUrl = null;
this.networkNodes = [];
},
dataBlock: function() {
this.blockVersion = null;
this.blockOwner = null;
this.blockHash = null;
this.blockSignature = null;
}
}
</script> </script>
<!-- Keys Object Operations (Generate, Sign and Verify) --> <!-- Keys Object Operations (Generate, Sign and Verify) -->
@ -7746,16 +7758,16 @@
this.valid_job = ["trade_buy", "trade_sell"]; this.valid_job = ["trade_buy", "trade_sell"];
} }
Rpc.prototype = { Rpc.prototype = {
//get rpc_req_id() {return this.rpc_req_id;},
send_rpc(method, ...params) { send_rpc(method, ...params) {
var request = new JSON_RPC.Request(method, params); var request = new JSON_RPC.Request(method, params);
console.log(request); console.log(request);
var id = request.id; var id = request.id;
console.log(id);
this.rpc_req_id = id; this.rpc_req_id = id;
return request.toString(); return request.toString();
//return request;
}, },
receive_rpc_response(request) { receive_rpc_response(request) {
@ -7906,7 +7918,7 @@
} }
</script> </script>
<!-- JSON RPC Library Starts --> <!-- JSON RPC Library Starts (https://github.com/oliver-moran/json-rpc) -->
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
var JSON_RPC = {}; var JSON_RPC = {};
@ -8318,7 +8330,7 @@
RM_TRADE.valid_assets = local_btc_configs.validAssetsArray; RM_TRADE.valid_assets = local_btc_configs.validAssetsArray;
}); });
// // Test: Trade functionality //Test: Trade functionality
var trade_btn = document.createElement("button"); var trade_btn = document.createElement("button");
trade_btn.innerText = "Trade"; trade_btn.innerText = "Trade";
trade_btn.onclick = function () { trade_btn.onclick = function () {
@ -8329,7 +8341,13 @@
document.getElementById("output_div").appendChild(trade_btn); document.getElementById("output_div").appendChild(trade_btn);
</script> </script>
<!-- Database operations -->
<script> <script>
// Nodes Database
// localbitcoinUser Databse
window.onload = function () { window.onload = function () {
let ask_flo_addr_btn = document.getElementById('ask_flo_addr_btn'); let ask_flo_addr_btn = document.getElementById('ask_flo_addr_btn');
ask_flo_addr_btn.addEventListener('click', function () { ask_flo_addr_btn.addEventListener('click', function () {