This commit is contained in:
Steven Ettinger 2022-09-20 13:22:11 -03:00
parent 67556d4e8d
commit e6d4c33856
3 changed files with 16 additions and 17 deletions

View File

@ -41,8 +41,10 @@ const ipfsLinks = ENV.ipfsLinks
: [
"https://ipfs:8080/ipfs/",
"http://localhost:8080/ipfs/",
"https://ipfs.io/ipfs/",
"https://ipfs.3speak.tv/ipfs/",
"https://infura-ipfs.io/ipfs/",
"https://ipfs.alloyxuast.co.uk/ipfs/",
"https://ipfs1.alloyxuast.tk/ipfs/"
];
const ipfsprotocol = ENV.ipfsprotocol || 'https' //IPFS upload/download protocol
@ -50,8 +52,8 @@ const ipfsprotocol = ENV.ipfsprotocol || 'https' //IPFS upload/download protocol
const bidRate = ENV.BIDRATE || 500 // your vote for the dex fee 500 = 0.500% Max 1000
//HIVE CONFIGS
var startURL = ENV.STARTURL || "https://rpc.ecency.com/"
var clientURL = ENV.APIURL || "https://api.deathwing.me/"
var startURL = ENV.STARTURL || "https://api.hive.blog/";
var clientURL = ENV.APIURL || "https://api.hive.blog/";
const clients = ENV.clients ? ENV.clients.split(" ") : [
"https://api.deathwing.me/",
//"https://api.c0ff33a.uk/",
@ -59,6 +61,7 @@ const clients = ENV.clients ? ENV.clients.split(" ") : [
"https://hived.emre.sh/",
//"https://rpc.ausbit.dev/",
"https://api.hive.blog/",
];
//!!!!!!! -- THESE ARE COMMUNITY CONSTANTS -- !!!!!!!!!//

View File

@ -1,5 +1,5 @@
const config = require("./config");
const VERSION = "v1.1.4d"; //Did you change the package version?
const VERSION = "v1.1.4e"; //Did you change the package version?
exports.VERSION = VERSION;
exports.exit = exit;
exports.processor = processor;

View File

@ -21,16 +21,16 @@ module.exports = function (
ensure: function (last) {
setTimeout(()=>{if(!blocks.processing && blocks.completed == last){getBlockNumber(currentBlockNumber);
console.log("Defibrillation");getHeadOrIrreversibleBlockNumber(function (result) {
if (currentBlockNumber < result - 30) {
if (currentBlockNumber < result - 10) {
behind = result - currentBlockNumber;
beginBlockComputing(1);
beginBlockComputing();
}
});};},6000)
},
v: {},
manage: function (block_num){
if (
block_num == currentBlockNumber &&
block_num == currentBlockNumber + 1 &&
!blocks.processing
) {
blocks.processing = currentBlockNumber;
@ -51,7 +51,7 @@ module.exports = function (
blocks.processing = 0;
});
else if (!blocks[currentBlockNumber]) getBlockNumber(currentBlockNumber);
} else if (block_num < currentBlockNumber) {
} else if (block_num <= currentBlockNumber) {
var blockNums = Object.keys(blocks);
for (var i = 0; i < blockNums.length; i++) {
if (parseInt(blockNums[i]) && parseInt(blockNums[i]) < currentBlockNumber) {
@ -192,9 +192,8 @@ function getBlock(bn) {
});
}
function beginBlockComputing(o = 0) {
function computeBlock() {
var blockNum = currentBlockNumber + o; // Helper variable to prevent race condition
function beginBlockComputing() {
var blockNum = currentBlockNumber; // Helper variable to prevent race condition
// in getBlock()
//var vops = getVops(blockNum);
getBlock(blockNum)
@ -209,14 +208,14 @@ function getBlock(bn) {
});
}
function pb(bl, remaining) {
if (parseInt(bl.block_id.slice(0, 8), 16) != blockNum)return
else
if (parseInt(bl.block_id.slice(0, 8), 16) != blockNum) return;
else
return new Promise((resolve, reject) => {
processBlock(bl, blockNum)
.then((r) => {
currentBlockNumber++;
if (!stopping && !remaining) {
isAtRealTime(computeBlock);
isAtRealTime(beginBlockComputing);
} else if (remaining) {
resolve("NEXT");
} else {
@ -234,9 +233,6 @@ function getBlock(bn) {
.catch((err) => {
console.log("get block catch:" + err);
});
}
computeBlock();
}
function beginBlockStreaming() {