Skip to content

Commit e4038ba

Browse files
authored
Merge pull request #986 from Foggyx420/masterchk
change filter for beacon report to beacon; datatype instead of beacon. note beaconalt
2 parents 1ff53dd + 5bdbc9e commit e4038ba

File tree

2 files changed

+35
-31
lines changed

2 files changed

+35
-31
lines changed

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ bool PushGridcoinDiagnostics()
381381
if (!bGlobalcomInitialized) return false;
382382
std::string errors1 = "";
383383
LoadAdminMessages(false,errors1);
384-
std::string cpiddata = GetListOf("beacon");
384+
std::string cpiddata = GetListOf("beacon;");
385385
std::string sWhitelist = GetListOf("project");
386386
int64_t superblock_age = GetAdjustedTime() - mvApplicationCacheTimestamp["superblock;magnitudes"];
387387
double popularity = 0;

src/rpcblockchain.cpp

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -893,35 +893,39 @@ std::string GetListOf(std::string datatype)
893893

894894
std::string GetListOfWithConsensus(std::string datatype)
895895
{
896-
std::string rows = "";
897-
std::string row = "";
898-
int64_t iEndTime= (GetAdjustedTime()-CONSENSUS_LOOKBACK) - ( (GetAdjustedTime()-CONSENSUS_LOOKBACK) % BLOCK_GRANULARITY);
899-
int64_t nLookback = 30 * 6 * 86400;
900-
int64_t iStartTime = (iEndTime - nLookback) - ( (iEndTime - nLookback) % BLOCK_GRANULARITY);
901-
printf(" getlistofwithconsensus startime %f , endtime %f, lookback %f \r\n ",(double)iStartTime,(double)iEndTime, (double)nLookback);
902-
for(map<string,string>::iterator ii=mvApplicationCache.begin(); ii!=mvApplicationCache.end(); ++ii)
903-
{
904-
std::string key_name = (*ii).first;
905-
if (key_name.length() > datatype.length())
906-
{
907-
if (key_name.substr(0,datatype.length())==datatype)
908-
{
909-
int64_t iBeaconTimestamp = mvApplicationCacheTimestamp[(*ii).first];
910-
if (iBeaconTimestamp > iStartTime && iBeaconTimestamp < iEndTime)
911-
{
912-
std::string key_value = mvApplicationCache[(*ii).first];
913-
std::string subkey = key_name.substr(datatype.length()+1,key_name.length()-datatype.length()-1);
914-
row = subkey + "<COL>" + key_value;
915-
if (Contains(row,"INVESTOR") && datatype=="beacon") row = "";
916-
if (row != "")
917-
{
918-
rows += row + "<ROW>";
919-
}
920-
}
921-
}
922-
}
923-
}
924-
return rows;
896+
std::string rows = "";
897+
std::string row = "";
898+
int64_t iEndTime= (GetAdjustedTime()-CONSENSUS_LOOKBACK) - ( (GetAdjustedTime()-CONSENSUS_LOOKBACK) % BLOCK_GRANULARITY);
899+
int64_t nLookback = 30 * 6 * 86400;
900+
int64_t iStartTime = (iEndTime - nLookback) - ( (iEndTime - nLookback) % BLOCK_GRANULARITY);
901+
printf(" getlistofwithconsensus startime %f , endtime %f, lookback %f \r\n ",(double)iStartTime,(double)iEndTime, (double)nLookback);
902+
for(map<string,string>::iterator ii=mvApplicationCache.begin(); ii!=mvApplicationCache.end(); ++ii)
903+
{
904+
std::string key_name = (*ii).first;
905+
if (key_name.length() > datatype.length())
906+
{
907+
// Ignore beaconalts here as to not break the neural network
908+
if (key_name.substr(0, datatype.length() + 3) == "beaconalt")
909+
continue;
910+
911+
else if (key_name.substr(0,datatype.length())==datatype)
912+
{
913+
int64_t iBeaconTimestamp = mvApplicationCacheTimestamp[(*ii).first];
914+
if (iBeaconTimestamp > iStartTime && iBeaconTimestamp < iEndTime)
915+
{
916+
std::string key_value = mvApplicationCache[(*ii).first];
917+
std::string subkey = key_name.substr(datatype.length()+1,key_name.length()-datatype.length()-1);
918+
row = subkey + "<COL>" + key_value;
919+
if (Contains(row,"INVESTOR") && datatype=="beacon") row = "";
920+
if (row != "")
921+
{
922+
rows += row + "<ROW>";
923+
}
924+
}
925+
}
926+
}
927+
}
928+
return rows;
925929
}
926930

927931
std::string AddContract(std::string sType, std::string sName, std::string sContract)
@@ -3577,7 +3581,7 @@ Array GetJSONBeaconReport()
35773581
Array results;
35783582
Object entry;
35793583
entry.push_back(Pair("CPID","GRCAddress"));
3580-
std::string datatype="beacon";
3584+
std::string datatype="beacon;";
35813585
std::string row;
35823586
for(const auto& item : AppCacheFilter(datatype))
35833587
{

0 commit comments

Comments
 (0)