Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #268

Merged
merged 12 commits into from
Mar 15, 2017
Merged

Dev #268

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/komodo_gateway.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ int32_t komodo_paxcmp(char *symbol,int32_t kmdheight,uint64_t value,uint64_t che
return(0);
else
{
if ( kmdheight >= 86150 )
if ( kmdheight >= 238000 )
printf("ht.%d ignore mismatched %s value %lld vs checkvalue %lld -> ratio.%d\n",kmdheight,symbol,(long long)value,(long long)checkvalue,ratio);
return(-1);
}
Expand Down Expand Up @@ -495,7 +495,7 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to
continue;
{
#ifdef KOMODO_ASSETCHAINS_WAITNOTARIZE
if ( height > 236000 )
if ( pax->height > 236000 )
{
if ( kmdsp != 0 && kmdsp->NOTARIZED_HEIGHT >= pax->height )
pax->validated = pax->komodoshis;
Expand Down Expand Up @@ -878,7 +878,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
}
}
}
else if ( kmdheight > 182000 && (kmdheight > 214700 || strcmp(base,ASSETCHAINS_SYMBOL) == 0) ) //seed != 0 &&
else if ( kmdheight > 238000 && (kmdheight > 214700 || strcmp(base,ASSETCHAINS_SYMBOL) == 0) ) //seed != 0 &&
printf("pax %s deposit %.8f rejected kmdheight.%d %.8f KMD check %.8f seed.%llu\n",base,dstr(fiatoshis),kmdheight,dstr(value),dstr(checktoshis),(long long)seed);
} //else printf("paxdeposit height.%d vs kmdheight.%d\n",height,kmdheight);
}
Expand Down
18 changes: 11 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1528,12 +1528,12 @@ bool IsInitialBlockDownload()
LOCK(cs_main);
if (fImporting || fReindex)
{
//fprintf(stderr,"fImporting %d || %d fReindex\n",(int32_t)fImporting,(int32_t)fReindex);
//fprintf(stderr,"IsInitialBlockDownload: fImporting %d || %d fReindex\n",(int32_t)fImporting,(int32_t)fReindex);
return true;
}
if (fCheckpointsEnabled && chainActive.Height() < Checkpoints::GetTotalBlocksEstimate(chainParams.Checkpoints()))
{
//fprintf(stderr,"checkpoint -> initialdownload\n");
//fprintf(stderr,"IsInitialBlockDownload: checkpoint -> initialdownload\n");
return true;
}
static bool lockIBDState = false;
Expand All @@ -1542,14 +1542,18 @@ bool IsInitialBlockDownload()
//fprintf(stderr,"lockIBDState true %d < %d\n",chainActive.Height(),pindexBestHeader->nHeight - 10);
return false;
}
bool state;
bool state; CBlockIndex *ptr = chainActive.Tip();
if ( ptr == 0 )
ptr = pindexBestHeader;
else if ( pindexBestHeader != 0 && pindexBestHeader->nHeight > ptr->nHeight )
ptr = pindexBestHeader;
if ( ASSETCHAINS_SYMBOL[0] == 0 )
state = (chainActive.Height() > 236000 && chainActive.Height() < pindexBestHeader->nHeight - 24*6) ||
pindexBestHeader->GetBlockTime() < (GetTime() - chainParams.MaxTipAge());
else state = (chainActive.Height() < pindexBestHeader->nHeight - 100);
state = (chainActive.Height() < ptr->nHeight - 24*6) ||
ptr->GetBlockTime() < (GetTime() - chainParams.MaxTipAge());
else state = (chainActive.Height() < ptr->nHeight - 100);
fprintf(stderr,"state.%d ht.%d vs %d, t.%u %u\n",state,(int32_t)chainActive.Height(),(uint32_t)ptr->nHeight,(int32_t)ptr->GetBlockTime(),(uint32_t)(GetTime() - chainParams.MaxTipAge()));
if (!state)
{
//fprintf(stderr,"lockIBDState tru\n");
lockIBDState = true;
}
return state;
Expand Down