SimpleMode: automatic public nodes discovering and switching

This commit is contained in:
xiphon
2019-09-02 21:32:36 +00:00
parent a5b2d5e727
commit 0d247a9b8a
10 changed files with 67 additions and 289 deletions

View File

@@ -94,16 +94,6 @@ function netTypeToString(){
return nettype == 1 ? qsTr("Testnet") : nettype == 2 ? qsTr("Stagenet") : qsTr("Mainnet");
}
function randomChoice(arr){
return arr[Math.floor(Math.random() * arr.length)];
}
function filterNodes(nodes, port) {
if(typeof data === 'number')
port = port.toString();
return nodes.filter(function(_){return _.indexOf(port) !== -1});
}
function epoch(){
return Math.floor((new Date).getTime()/1000);
}