fix new era function

This commit is contained in:
blackjok3r
2018-11-23 00:02:46 +08:00
parent 5bbc803ee8
commit e232fd0049
2 changed files with 4 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ int8_t is_STAKED(const char *chain_name) {
STAKED = 2; STAKED = 2;
else if ( (strcmp(chain_name, "CFEK") == 0) || (strncmp(chain_name, "CFEK", 4) == 0) ) else if ( (strcmp(chain_name, "CFEK") == 0) || (strncmp(chain_name, "CFEK", 4) == 0) )
STAKED = 3; STAKED = 3;
//fprintf(stderr, "This chains is: %s which is: %d\n", chain_name,STAKED); //fprintf(stderr, "This chain is: %s which is: %d\n", chain_name,STAKED);
return(STAKED); return(STAKED);
}; };
@@ -30,7 +30,7 @@ int32_t STAKED_era(int timestamp)
for (int32_t i = 1; i < NUM_STAKED_ERAS; i++) for (int32_t i = 1; i < NUM_STAKED_ERAS; i++)
{ {
if (timestamp <= STAKED_NOTARIES_TIMESTAMP[i] && timestamp >= (STAKED_NOTARIES_TIMESTAMP[i-1] + STAKED_ERA_GAP)) if (timestamp <= STAKED_NOTARIES_TIMESTAMP[i] && timestamp >= (STAKED_NOTARIES_TIMESTAMP[i-1] + STAKED_ERA_GAP))
return(i); return(i+1);
} }
// if we are in a gap, return era 0, this allows to invalidate notarizations when in GAP. // if we are in a gap, return era 0, this allows to invalidate notarizations when in GAP.
return(0); return(0);

View File

@@ -109,6 +109,8 @@ UniValue getiguanajson(const UniValue& params, bool fHelp)
return json; return json;
} }
UniValue getinfo(const UniValue& params, bool fHelp) UniValue getinfo(const UniValue& params, bool fHelp)
{ {
uint256 notarized_hash,notarized_desttxid; int32_t prevMoMheight,notarized_height,longestchain,kmdnotarized_height,txid_height; uint256 notarized_hash,notarized_desttxid; int32_t prevMoMheight,notarized_height,longestchain,kmdnotarized_height,txid_height;