Skip to content

Commit

Permalink
fix for neural network break and touch ups + tabs to 4 spaces while i…
Browse files Browse the repository at this point in the history
… was there
  • Loading branch information
iFoggz committed Mar 2, 2018
1 parent e67dfb6 commit 5bdbc9e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ bool PushGridcoinDiagnostics()
if (!bGlobalcomInitialized) return false;
std::string errors1 = "";
LoadAdminMessages(false,errors1);
std::string cpiddata = GetListOf("beacon");
std::string cpiddata = GetListOf("beacon;");
std::string sWhitelist = GetListOf("project");
int64_t superblock_age = GetAdjustedTime() - mvApplicationCacheTimestamp["superblock;magnitudes"];
double popularity = 0;
Expand Down
62 changes: 33 additions & 29 deletions src/rpcblockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -893,35 +893,39 @@ std::string GetListOf(std::string datatype)

std::string GetListOfWithConsensus(std::string datatype)
{
std::string rows = "";
std::string row = "";
int64_t iEndTime= (GetAdjustedTime()-CONSENSUS_LOOKBACK) - ( (GetAdjustedTime()-CONSENSUS_LOOKBACK) % BLOCK_GRANULARITY);
int64_t nLookback = 30 * 6 * 86400;
int64_t iStartTime = (iEndTime - nLookback) - ( (iEndTime - nLookback) % BLOCK_GRANULARITY);
printf(" getlistofwithconsensus startime %f , endtime %f, lookback %f \r\n ",(double)iStartTime,(double)iEndTime, (double)nLookback);
for(map<string,string>::iterator ii=mvApplicationCache.begin(); ii!=mvApplicationCache.end(); ++ii)
{
std::string key_name = (*ii).first;
if (key_name.length() > datatype.length())
{
if (key_name.substr(0,datatype.length())==datatype)
{
int64_t iBeaconTimestamp = mvApplicationCacheTimestamp[(*ii).first];
if (iBeaconTimestamp > iStartTime && iBeaconTimestamp < iEndTime)
{
std::string key_value = mvApplicationCache[(*ii).first];
std::string subkey = key_name.substr(datatype.length()+1,key_name.length()-datatype.length()-1);
row = subkey + "<COL>" + key_value;
if (Contains(row,"INVESTOR") && datatype=="beacon") row = "";
if (row != "")
{
rows += row + "<ROW>";
}
}
}
}
}
return rows;
std::string rows = "";
std::string row = "";
int64_t iEndTime= (GetAdjustedTime()-CONSENSUS_LOOKBACK) - ( (GetAdjustedTime()-CONSENSUS_LOOKBACK) % BLOCK_GRANULARITY);
int64_t nLookback = 30 * 6 * 86400;
int64_t iStartTime = (iEndTime - nLookback) - ( (iEndTime - nLookback) % BLOCK_GRANULARITY);
printf(" getlistofwithconsensus startime %f , endtime %f, lookback %f \r\n ",(double)iStartTime,(double)iEndTime, (double)nLookback);
for(map<string,string>::iterator ii=mvApplicationCache.begin(); ii!=mvApplicationCache.end(); ++ii)
{
std::string key_name = (*ii).first;
if (key_name.length() > datatype.length())
{
// Ignore beaconalts here as to not break the neural network
if (key_name.substr(0, datatype.length() + 3) == "beaconalt")
continue;

else if (key_name.substr(0,datatype.length())==datatype)
{
int64_t iBeaconTimestamp = mvApplicationCacheTimestamp[(*ii).first];
if (iBeaconTimestamp > iStartTime && iBeaconTimestamp < iEndTime)
{
std::string key_value = mvApplicationCache[(*ii).first];
std::string subkey = key_name.substr(datatype.length()+1,key_name.length()-datatype.length()-1);
row = subkey + "<COL>" + key_value;
if (Contains(row,"INVESTOR") && datatype=="beacon") row = "";
if (row != "")
{
rows += row + "<ROW>";
}
}
}
}
}
return rows;
}

std::string AddContract(std::string sType, std::string sName, std::string sContract)
Expand Down

0 comments on commit 5bdbc9e

Please sign in to comment.