fix
-- added flosight fix
This commit is contained in:
parent
2b86ac226d
commit
8160df0020
15
index.html
15
index.html
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
//Required for blockchain API operators
|
//Required for blockchain API operators
|
||||||
apiURL: {
|
apiURL: {
|
||||||
FLO: ['https://livenet.flocha.in/'],
|
FLO: ['https://livenet.flocha.in/', 'https://flosight.duckdns.org/'],
|
||||||
FLO_TEST: ['https://testnet-flosight.duckdns.org/', 'https://testnet.flocha.in/']
|
FLO_TEST: ['https://testnet-flosight.duckdns.org/', 'https://testnet.flocha.in/']
|
||||||
},
|
},
|
||||||
adminID: "FFXy5pJnfzu2fCDLhpUremyXQjGtFpgCDN",
|
adminID: "FFXy5pJnfzu2fCDLhpUremyXQjGtFpgCDN",
|
||||||
@ -7500,9 +7500,11 @@ Bitcoin.Util = {
|
|||||||
util: {
|
util: {
|
||||||
serverList: floGlobals.apiURL[floGlobals.blockchain].slice(0),
|
serverList: floGlobals.apiURL[floGlobals.blockchain].slice(0),
|
||||||
curPos: floCrypto.randInt(0, floGlobals.apiURL[floGlobals.blockchain].length),
|
curPos: floCrypto.randInt(0, floGlobals.apiURL[floGlobals.blockchain].length),
|
||||||
fetch_retry: function(apicall) {
|
fetch_retry: function(apicall, rm_flosight) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.serverList.splice(this.curPos, 1);
|
let i = this.serverList.indexOf(rm_flosight)
|
||||||
|
if(i != -1)
|
||||||
|
this.serverList.splice(i, 1);
|
||||||
this.curPos = floCrypto.randInt(0, this.serverList.length)
|
this.curPos = floCrypto.randInt(0, this.serverList.length)
|
||||||
this.fetch_api(apicall)
|
this.fetch_api(apicall)
|
||||||
.then(result => resolve(result))
|
.then(result => resolve(result))
|
||||||
@ -7514,16 +7516,17 @@ Bitcoin.Util = {
|
|||||||
if (this.serverList.length === 0)
|
if (this.serverList.length === 0)
|
||||||
reject("No floSight server working")
|
reject("No floSight server working")
|
||||||
else {
|
else {
|
||||||
fetch(this.serverList[this.curPos] + apicall).then(response => {
|
let flosight = this.serverList[this.curPos];
|
||||||
|
fetch(flosight + apicall).then(response => {
|
||||||
if (response.ok)
|
if (response.ok)
|
||||||
response.json().then(data => resolve(data));
|
response.json().then(data => resolve(data));
|
||||||
else {
|
else {
|
||||||
this.fetch_retry(apicall)
|
this.fetch_retry(apicall, flosight)
|
||||||
.then(result => resolve(result))
|
.then(result => resolve(result))
|
||||||
.catch(error => reject(error));
|
.catch(error => reject(error));
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.fetch_retry(apicall)
|
this.fetch_retry(apicall, flosight)
|
||||||
.then(result => resolve(result))
|
.then(result => resolve(result))
|
||||||
.catch(error => reject(error));
|
.catch(error => reject(error));
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user