This commit is contained in:
blackjok3r
2018-11-05 20:44:37 +08:00
parent 96c7f474b9
commit dfe8e4a6cd
4 changed files with 11 additions and 4 deletions

View File

@@ -832,7 +832,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
for (i=0; i<txn_count; i++)
{
if ((is_STAKED(ASSETCHAINS_SYMBOL) != 0) && (STAKED_era(pindex->GetBlockTime()) == 0)) {
printf("ERA 0 SKIP %s getblocktime: %d pindex->nTime : %d\n",pindex->GetBlockTime(),pindex->nTime,ASSETCHAINS_SYMBOL);
printf("ERA 0 SKIP %s getblocktime: %d pindex->nTime : %d\n",pindex->GetBlockTime(),(uint32_t)pindex->nTime,ASSETCHAINS_SYMBOL);
continue;
}
txhash = block.vtx[i].GetHash();

View File

@@ -205,6 +205,7 @@ int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestam
{
static uint8_t elected_pubkeys0[64][33],elected_pubkeys1[64][33],did0,did1; static int32_t n0,n1;
int32_t i,htind,n; uint64_t mask = 0; struct knotary_entry *kp,*tmp;
if ( timestamp == 0 )
timestamp = komodo_heightstamp(height);
if ( ASSETCHAINS_SYMBOL[0] == 0 ) {

View File

@@ -121,7 +121,12 @@ int is_STAKED(const char *chain_name) {
int STAKED_era(int timestamp)
{
int8_t era = 0;
static uint32_t lasttimestamp;
static int didera;
// test this, seems to sometimes get called into the past?
if ( timestamp < lasttimestamp )
timestamp = lasttimestamp;
if (timestamp <= STAKED_NOTARIES_TIMESTAMP1)
era = 1;
else if (timestamp <= STAKED_NOTARIES_TIMESTAMP2 && timestamp >= (STAKED_NOTARIES_TIMESTAMP1 + STAKED_ERA_GAP))
@@ -151,6 +156,7 @@ int STAKED_era(int timestamp)
didera++;
}
}
lasttimestamp = timestamp;
return(era);
};

View File

@@ -7,9 +7,9 @@
static const int STAKED_ERA_GAP = 777;
static const int STAKED_NOTARIES_TIMESTAMP1 = 1541415367;
static const int STAKED_NOTARIES_TIMESTAMP2 = 1541416544;
static const int STAKED_NOTARIES_TIMESTAMP3 = 1541417721;
static const int STAKED_NOTARIES_TIMESTAMP1 = 1541422105;
static const int STAKED_NOTARIES_TIMESTAMP2 = 1541423282;
static const int STAKED_NOTARIES_TIMESTAMP3 = 1541424459;
static const int STAKED_NOTARIES_TIMESTAMP4 = 1604244444;
extern const char *notaries_STAKED1[][2];