fixed fetch_config and consequent glitches in index and cash_payments_handler files
This commit is contained in:
parent
6db9c84059
commit
856bb82ce7
@ -12876,7 +12876,7 @@
|
|||||||
key = Obj[store.keyPath];
|
key = Obj[store.keyPath];
|
||||||
}
|
}
|
||||||
let objectStoreRequest = store.get(key);
|
let objectStoreRequest = store.get(key);
|
||||||
objectStoreRequest.onsuccess = async function(event) {
|
objectStoreRequest.onsuccess = function(event) {
|
||||||
var myRecord = objectStoreRequest.result;
|
var myRecord = objectStoreRequest.result;
|
||||||
if (typeof myRecord !== "object") {
|
if (typeof myRecord !== "object") {
|
||||||
Obj.vectorClock = 1;
|
Obj.vectorClock = 1;
|
||||||
|
|||||||
@ -11522,7 +11522,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
Object.defineProperty(localbitcoinplusplus, "RM_FLO_SENDING_ADDR", {
|
Object.defineProperty(localbitcoinplusplus, "RM_FLO_SENDING_ADDR", {
|
||||||
value: "oUbQYNBo7hWRcVN4dnx2ZQPfumfnTS7NsP",
|
value: "ocKKEivXC3TA8yf3ZEyh2kRMDgSh99y1a7",
|
||||||
writable: false,
|
writable: false,
|
||||||
configurable: false,
|
configurable: false,
|
||||||
enumerable: true
|
enumerable: true
|
||||||
@ -12065,62 +12065,28 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
localbitcoinplusplus.actions = {
|
localbitcoinplusplus.actions = {
|
||||||
parse_flo_comments: function(callback) {
|
parse_flo_comments: async function(callback) {
|
||||||
return callback("fofof");
|
const master_data = await helper_functions
|
||||||
if (this.floAddress == null) {
|
.ajaxGet(`${localbitcoinplusplus.server.flo_testnet}/api/txs/?address=${localbitcoinplusplus.RM_FLO_SENDING_ADDR}`);
|
||||||
return false;
|
if(typeof master_data==="object" && typeof master_data.txs==="object") {
|
||||||
}
|
let text = '';
|
||||||
var request = new XMLHttpRequest();
|
let tx_cmnt_arr = [];
|
||||||
|
|
||||||
request.open(
|
for(txt of master_data.txs) {
|
||||||
"GET",
|
if(txt.vin[0].addr === localbitcoinplusplus.RM_FLO_SENDING_ADDR) {
|
||||||
`${localbitcoinplusplus.server.flo_testnet}/api/txs/?address=${this.floAddress}`,
|
if(txt.floData.length===0) break;
|
||||||
true
|
tx_cmnt_arr.push(txt.floData);
|
||||||
);
|
}
|
||||||
request.onload = function() {
|
|
||||||
// Begin accessing JSON data here
|
|
||||||
var data = JSON.parse(this.response);
|
|
||||||
|
|
||||||
if (request.status >= 200 && request.status < 400) {
|
|
||||||
data.txs.forEach(tx => {
|
|
||||||
if (
|
|
||||||
typeof tx !== "undefined" &&
|
|
||||||
typeof tx.floData == "string" &&
|
|
||||||
tx.floData.length > 0
|
|
||||||
) {
|
|
||||||
callback(tx.floData);
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
} else {
|
tx_cmnt_arr.reverse().map(m=>text += m.replace('text:', ''));
|
||||||
console.log("error");
|
callback(text);
|
||||||
}
|
}
|
||||||
};
|
|
||||||
request.send();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
fetch_configs: function(callback) {
|
fetch_configs: function(callback) {
|
||||||
this.floAddress = localbitcoinplusplus.RM_FLO_SENDING_ADDR;
|
|
||||||
this.parse_flo_comments(function(floData) {
|
this.parse_flo_comments(function(floData) {
|
||||||
let RMAssets = floData.slice(5);
|
let RMAssets = floData.trim();
|
||||||
|
|
||||||
// remove this line later
|
|
||||||
// btcTradeMargin is tolerable difference between Crypto trader should deposit and cryptos he actually deposited
|
|
||||||
RMAssets = `masterFLOPubKey=029EF7838D4D103E62262394B5417E8ABFD75539D19E61CA5FD0C2051B69B29910
|
|
||||||
#!#tradableAsset1=BTC,FLO,BTC_TEST,FLO_TEST#!#tradableAsset2=INR,USD,
|
|
||||||
#!#validTradingAmount=10,50,100,#!#btcTradeMargin=5000
|
|
||||||
#!#MaxBackups=2
|
|
||||||
#!#miners_fee={"btc":0.0003, "flo":0.0003}
|
|
||||||
#!#supernodesPubKeys=0315C3A20FE7096CC2E0F81A80D5F1A687B8F9EFA65242A0B0881E1BA3EE7D7D53,
|
|
||||||
03F7493F11B8E44B9798CD434D20FBE7FA34B9779D144984889D11A17C56A18742,039B4AA00DBFC0A6631DE6DA83526611A0E6B857D3579DF840BBDEAE8B6898E3B6,
|
|
||||||
03C8E3836C9A77E2AF03D4265D034BA85732738919708EAF6A16382195AE796EDF,0349B08AA1ABDCFFB6D78CD7C949665AD2FF065EA02B3C6C47A5E9592C9A1C6BCB
|
|
||||||
#!#externalFiles={"d3js":"58f54395efa8346e8e94d12609770f66b916897e7f4e05f6c98780cffa5c70a3"}
|
|
||||||
#!#cashiers={"032871A74D2DDA9D0DE7135F58B5BD2D7F679D2CCA20EA7909466D1A6912DF4022":"johnDoe@upi"}
|
|
||||||
#!#ShamirsMaxShares=8#!#supernodeSeeds={"ranchimall1":{"ip":"127.0.0.1","port":"9111","kbucketId":"oZxHcbSf1JC8t5GjutopWYXs7C6Fe9p7ps"},
|
|
||||||
"ranchimall2":{"ip":"127.0.0.1","port":"9112","kbucketId":"oTWjPupy3Z7uMdPcu5uXd521HBkcsLuSuM"},
|
|
||||||
"ranchimall3":{"ip":"127.0.0.1","port":"9113","kbucketId":"odYA6KagmbokSh9GY7yAfeTUZRtZLwecY1"},
|
|
||||||
"ranchimall4":{"ip":"127.0.0.1","port":"9114","kbucketId":"oJosrve9dBv2Hj2bfncxv2oEpTysg3Wejv"},
|
|
||||||
"ranchimall5":{"ip":"127.0.0.1","port":"9115","kbucketId":"oMhv5sAzqg77sYHxmUGZWKRrVo4P4JQduS"}}`;
|
|
||||||
|
|
||||||
let floAssetsArray = RMAssets.split("#!#");
|
let floAssetsArray = RMAssets.split("#!#");
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@ -12565,7 +12531,6 @@
|
|||||||
"withdraw_btc",
|
"withdraw_btc",
|
||||||
"crypto_balances",
|
"crypto_balances",
|
||||||
"cash_balances",
|
"cash_balances",
|
||||||
"userPublicData",
|
|
||||||
"buyOrders",
|
"buyOrders",
|
||||||
"sellOrders"
|
"sellOrders"
|
||||||
];
|
];
|
||||||
@ -12594,9 +12559,8 @@
|
|||||||
} else {
|
} else {
|
||||||
const allUsersData = await readAllDB("userPublicData");
|
const allUsersData = await readAllDB("userPublicData");
|
||||||
|
|
||||||
const supernodesFloList = localbitcoinplusplus.master_configurations.supernodesPubKeys.map(
|
const supernodesFloList = localbitcoinplusplus.master_configurations.supernodesPubKeys
|
||||||
s => bitjs.FLO_TEST.pubkey2address(s)
|
.map(s => bitjs.FLO_TEST.pubkey2address(s));
|
||||||
);
|
|
||||||
|
|
||||||
for (let f = 0; f < allUsersData.length; f++) {
|
for (let f = 0; f < allUsersData.length; f++) {
|
||||||
let closestSu = await localbitcoinplusplus.kademlia.determineClosestSupernode(
|
let closestSu = await localbitcoinplusplus.kademlia.determineClosestSupernode(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user