adding sleep delay before connecting to backup nodes

This commit is contained in:
sairajzero 2019-11-16 19:32:46 +05:30
parent c6383a6f8f
commit 37ece209fa

View File

@ -6026,7 +6026,12 @@
</script>
<script id="SuperNodeStorageScript">
function onLoadStartUp() {
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function onLoadStartUp() {
myPrivKey = prompt("Enter Private Key : ")
myPubKey = floCrypto.getPubKeyHex(myPrivKey)
myFloID = floCrypto.getFloIDfromPubkeyHex(myPubKey)
@ -6044,6 +6049,7 @@
setInterval(refreshBlockchainData, 3600000);
floSupernode.initSupernode(serverPwd, myFloID).then(result => {
console.log(result)
await sleep(5000)
connectToAllBackupSupernode().then(result => {
console.log(result)
reactor.dispatchEvent("indicate_supernode_up",myFloID)