test
This commit is contained in:
@@ -832,7 +832,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
|
|||||||
for (i=0; i<txn_count; i++)
|
for (i=0; i<txn_count; i++)
|
||||||
{
|
{
|
||||||
if ((is_STAKED(ASSETCHAINS_SYMBOL) != 0) && (STAKED_era(pindex->GetBlockTime()) == 0)) {
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
txhash = block.vtx[i].GetHash();
|
txhash = block.vtx[i].GetHash();
|
||||||
|
|||||||
@@ -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;
|
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;
|
int32_t i,htind,n; uint64_t mask = 0; struct knotary_entry *kp,*tmp;
|
||||||
|
|
||||||
if ( timestamp == 0 )
|
if ( timestamp == 0 )
|
||||||
timestamp = komodo_heightstamp(height);
|
timestamp = komodo_heightstamp(height);
|
||||||
if ( ASSETCHAINS_SYMBOL[0] == 0 ) {
|
if ( ASSETCHAINS_SYMBOL[0] == 0 ) {
|
||||||
|
|||||||
@@ -121,7 +121,12 @@ int is_STAKED(const char *chain_name) {
|
|||||||
int STAKED_era(int timestamp)
|
int STAKED_era(int timestamp)
|
||||||
{
|
{
|
||||||
int8_t era = 0;
|
int8_t era = 0;
|
||||||
|
static uint32_t lasttimestamp;
|
||||||
static int didera;
|
static int didera;
|
||||||
|
// test this, seems to sometimes get called into the past?
|
||||||
|
if ( timestamp < lasttimestamp )
|
||||||
|
timestamp = lasttimestamp;
|
||||||
|
|
||||||
if (timestamp <= STAKED_NOTARIES_TIMESTAMP1)
|
if (timestamp <= STAKED_NOTARIES_TIMESTAMP1)
|
||||||
era = 1;
|
era = 1;
|
||||||
else if (timestamp <= STAKED_NOTARIES_TIMESTAMP2 && timestamp >= (STAKED_NOTARIES_TIMESTAMP1 + STAKED_ERA_GAP))
|
else if (timestamp <= STAKED_NOTARIES_TIMESTAMP2 && timestamp >= (STAKED_NOTARIES_TIMESTAMP1 + STAKED_ERA_GAP))
|
||||||
@@ -151,6 +156,7 @@ int STAKED_era(int timestamp)
|
|||||||
didera++;
|
didera++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
lasttimestamp = timestamp;
|
||||||
return(era);
|
return(era);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
|
|
||||||
static const int STAKED_ERA_GAP = 777;
|
static const int STAKED_ERA_GAP = 777;
|
||||||
|
|
||||||
static const int STAKED_NOTARIES_TIMESTAMP1 = 1541415367;
|
static const int STAKED_NOTARIES_TIMESTAMP1 = 1541422105;
|
||||||
static const int STAKED_NOTARIES_TIMESTAMP2 = 1541416544;
|
static const int STAKED_NOTARIES_TIMESTAMP2 = 1541423282;
|
||||||
static const int STAKED_NOTARIES_TIMESTAMP3 = 1541417721;
|
static const int STAKED_NOTARIES_TIMESTAMP3 = 1541424459;
|
||||||
static const int STAKED_NOTARIES_TIMESTAMP4 = 1604244444;
|
static const int STAKED_NOTARIES_TIMESTAMP4 = 1604244444;
|
||||||
|
|
||||||
extern const char *notaries_STAKED1[][2];
|
extern const char *notaries_STAKED1[][2];
|
||||||
|
|||||||
Reference in New Issue
Block a user