diff --git a/index.html b/index.html index 17783f6..ca905ef 100644 --- a/index.html +++ b/index.html @@ -4,1487 +4,7 @@ Local Bitcoin++ - - +
@@ -1903,8 +423,6 @@
Select Crypto
-
Select Currency
-
Select Amount
@@ -1928,8 +446,6 @@
Select Crypto
-
Select Currency
-
Select Amount
@@ -2117,6 +633,23 @@ + +
+
+

+ Re-allocate Users by Supernodes +

+
+ + + + +
+
+
+ - - + } - - + async function getNextSupernode(flo_id = '') { + try { + let nextSupernodeObj = null; + let allSus = await readAllDB('myClosestSupernodes'); + if (flo_id.length > 0) { + let all_flo_ids = allSus.map(m => m.trader_flo_address); + let idx = all_flo_ids.indexOf(flo_id); + if (idx >= 0) { + allSus = allSus.filter((f, i) => i >= idx); + } + } + for (let i = 0; i < allSus.length - 1; i++) { + let nextSuObj = allSus[i + 1]; + let nextSu = nextSuObj.trader_flo_address; + if (nextSu === flo_id + || + nextSu === localbitcoinplusplus.wallets.my_local_flo_address) continue; + nextSupernodeObj = nextSuObj; + break; + } + return nextSupernodeObj; + } catch (error) { + throw new Error(error); + } + } - - + if (sn === msg_obj.data.subject_flo_id || sn === usrAddr) { + suList = await getPrevSupernode(sn); + if (suList == null) return false; + sn = suList.trader_flo_address; + } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Returns a function, that, as long as it continues to be invoked, will not + // be triggered. The function will be called after it stops being called for + // N milliseconds. If `immediate` is passed, trigger the function on the + // leading edge, instead of the trailing. + // https://davidwalsh.name/javascript-debounce-function - - - - - - - - - - - - - - - - + - + \ No newline at end of file