Merge pull request #1694 from jl777/jl777
Merge branch 'FSM' into jl777
This commit is contained in:
@@ -76,14 +76,14 @@ void WaitForShutdown(boost::thread_group* threadGroup)
|
|||||||
fprintf(stderr,"error: earlytx must be before block height %d or tx does not exist\n",KOMODO_EARLYTXID_HEIGHT);
|
fprintf(stderr,"error: earlytx must be before block height %d or tx does not exist\n",KOMODO_EARLYTXID_HEIGHT);
|
||||||
StartShutdown();
|
StartShutdown();
|
||||||
}
|
}
|
||||||
if ( ASSETCHAINS_STAKED == 0 && ASSETCHAINS_ADAPTIVEPOW == 0 && (pindex= komodo_chainactive(1)) != 0 )
|
/*if ( ASSETCHAINS_STAKED == 0 && ASSETCHAINS_ADAPTIVEPOW == 0 && (pindex= komodo_chainactive(1)) != 0 )
|
||||||
{
|
{
|
||||||
if ( pindex->nTime > ADAPTIVEPOW_CHANGETO_DEFAULTON )
|
if ( pindex->nTime > ADAPTIVEPOW_CHANGETO_DEFAULTON )
|
||||||
{
|
{
|
||||||
ASSETCHAINS_ADAPTIVEPOW = 1;
|
ASSETCHAINS_ADAPTIVEPOW = 1;
|
||||||
fprintf(stderr,"default activate adaptivepow\n");
|
fprintf(stderr,"default activate adaptivepow\n");
|
||||||
} else fprintf(stderr,"height1 time %u vs %u\n",pindex->nTime,ADAPTIVEPOW_CHANGETO_DEFAULTON);
|
} else fprintf(stderr,"height1 time %u vs %u\n",pindex->nTime,ADAPTIVEPOW_CHANGETO_DEFAULTON);
|
||||||
} //else fprintf(stderr,"cant find height 1\n");
|
} //else fprintf(stderr,"cant find height 1\n");*/
|
||||||
if ( ASSETCHAINS_CBOPRET != 0 )
|
if ( ASSETCHAINS_CBOPRET != 0 )
|
||||||
komodo_pricesinit();
|
komodo_pricesinit();
|
||||||
while (!fShutdown)
|
while (!fShutdown)
|
||||||
|
|||||||
@@ -272,10 +272,10 @@ int cc_verify(const struct CC *cond, const unsigned char *msg, size_t msgLength,
|
|||||||
unsigned char msgHash[32];
|
unsigned char msgHash[32];
|
||||||
if (doHashMsg) sha256(msg, msgLength, msgHash);
|
if (doHashMsg) sha256(msg, msgLength, msgHash);
|
||||||
else memcpy(msgHash, msg, 32);
|
else memcpy(msgHash, msg, 32);
|
||||||
int32_t z;
|
//int32_t z;
|
||||||
for (z=0; z<32; z++)
|
//for (z=0; z<32; z++)
|
||||||
fprintf(stderr,"%02x",msgHash[z]);
|
// fprintf(stderr,"%02x",msgHash[z]);
|
||||||
fprintf(stderr," msgHash msglen.%d\n",msgLength);
|
//fprintf(stderr," msgHash msglen.%d\n",(int32_t)msgLength);
|
||||||
|
|
||||||
if (!cc_secp256k1VerifyTreeMsg32(cond, msgHash)) {
|
if (!cc_secp256k1VerifyTreeMsg32(cond, msgHash)) {
|
||||||
fprintf(stderr," cc_verify error C\n");
|
fprintf(stderr," cc_verify error C\n");
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#include "komodo_nk.h"
|
#include "komodo_nk.h"
|
||||||
|
|
||||||
#define KOMODO_EARLYTXID_HEIGHT 100
|
#define KOMODO_EARLYTXID_HEIGHT 100
|
||||||
#define ADAPTIVEPOW_CHANGETO_DEFAULTON 1572480000
|
//#define ADAPTIVEPOW_CHANGETO_DEFAULTON 1572480000
|
||||||
#define ASSETCHAINS_MINHEIGHT 128
|
#define ASSETCHAINS_MINHEIGHT 128
|
||||||
#define ASSETCHAINS_MAX_ERAS 7
|
#define ASSETCHAINS_MAX_ERAS 7
|
||||||
#define KOMODO_ELECTION_GAP 2000
|
#define KOMODO_ELECTION_GAP 2000
|
||||||
|
|||||||
@@ -1420,7 +1420,7 @@ void komodo_passport_iteration()
|
|||||||
int32_t maxseconds = 10;
|
int32_t maxseconds = 10;
|
||||||
FILE *fp; uint8_t *filedata; long fpos,datalen,lastfpos; int32_t baseid,limit,n,ht,isrealtime,expired,refid,blocks,longest; struct komodo_state *sp,*refsp; char *retstr,fname[512],*base,symbol[KOMODO_ASSETCHAIN_MAXLEN],dest[KOMODO_ASSETCHAIN_MAXLEN]; uint32_t buf[3],starttime; uint64_t RTmask = 0; //CBlockIndex *pindex;
|
FILE *fp; uint8_t *filedata; long fpos,datalen,lastfpos; int32_t baseid,limit,n,ht,isrealtime,expired,refid,blocks,longest; struct komodo_state *sp,*refsp; char *retstr,fname[512],*base,symbol[KOMODO_ASSETCHAIN_MAXLEN],dest[KOMODO_ASSETCHAIN_MAXLEN]; uint32_t buf[3],starttime; uint64_t RTmask = 0; //CBlockIndex *pindex;
|
||||||
expired = 0;
|
expired = 0;
|
||||||
while ( KOMODO_INITDONE == 0 )
|
while ( 0 && KOMODO_INITDONE == 0 )
|
||||||
{
|
{
|
||||||
fprintf(stderr,"[%s] PASSPORT iteration waiting for KOMODO_INITDONE\n",ASSETCHAINS_SYMBOL);
|
fprintf(stderr,"[%s] PASSPORT iteration waiting for KOMODO_INITDONE\n",ASSETCHAINS_SYMBOL);
|
||||||
sleep(3);
|
sleep(3);
|
||||||
|
|||||||
@@ -620,7 +620,7 @@ void komodo_nSPVreq(CNode *pfrom,std::vector<uint8_t> request) // received a req
|
|||||||
iguana_rwnum(0,&request[len-8],sizeof(skipcount),&skipcount);
|
iguana_rwnum(0,&request[len-8],sizeof(skipcount),&skipcount);
|
||||||
iguana_rwnum(0,&request[len-4],sizeof(filter),&filter);
|
iguana_rwnum(0,&request[len-4],sizeof(filter),&filter);
|
||||||
}
|
}
|
||||||
if ( isCC != 0 )
|
if ( 0 && isCC != 0 )
|
||||||
fprintf(stderr,"utxos %s isCC.%d skipcount.%d filter.%x\n",coinaddr,isCC,skipcount,filter);
|
fprintf(stderr,"utxos %s isCC.%d skipcount.%d filter.%x\n",coinaddr,isCC,skipcount,filter);
|
||||||
memset(&U,0,sizeof(U));
|
memset(&U,0,sizeof(U));
|
||||||
if ( (slen= NSPV_getaddressutxos(&U,coinaddr,isCC,skipcount,filter)) > 0 )
|
if ( (slen= NSPV_getaddressutxos(&U,coinaddr,isCC,skipcount,filter)) > 0 )
|
||||||
@@ -660,7 +660,7 @@ void komodo_nSPVreq(CNode *pfrom,std::vector<uint8_t> request) // received a req
|
|||||||
iguana_rwnum(0,&request[len-8],sizeof(skipcount),&skipcount);
|
iguana_rwnum(0,&request[len-8],sizeof(skipcount),&skipcount);
|
||||||
iguana_rwnum(0,&request[len-4],sizeof(filter),&filter);
|
iguana_rwnum(0,&request[len-4],sizeof(filter),&filter);
|
||||||
}
|
}
|
||||||
//if ( isCC != 0 )
|
if ( 0 && isCC != 0 )
|
||||||
fprintf(stderr,"txids %s isCC.%d skipcount.%d filter.%d\n",coinaddr,isCC,skipcount,filter);
|
fprintf(stderr,"txids %s isCC.%d skipcount.%d filter.%d\n",coinaddr,isCC,skipcount,filter);
|
||||||
memset(&T,0,sizeof(T));
|
memset(&T,0,sizeof(T));
|
||||||
if ( (slen= NSPV_getaddresstxids(&T,coinaddr,isCC,skipcount,filter)) > 0 )
|
if ( (slen= NSPV_getaddresstxids(&T,coinaddr,isCC,skipcount,filter)) > 0 )
|
||||||
|
|||||||
@@ -4452,8 +4452,8 @@ static bool ActivateBestChainStep(bool fSkipdpow, CValidationState &state, CBloc
|
|||||||
notarizedht = komodo_notarized_height(&prevMoMheight,¬arizedhash,&txid);
|
notarizedht = komodo_notarized_height(&prevMoMheight,¬arizedhash,&txid);
|
||||||
if ( !fSkipdpow && pindexFork != 0 && pindexOldTip->GetHeight() > notarizedht && pindexFork->GetHeight() < notarizedht )
|
if ( !fSkipdpow && pindexFork != 0 && pindexOldTip->GetHeight() > notarizedht && pindexFork->GetHeight() < notarizedht )
|
||||||
{
|
{
|
||||||
fprintf(stderr,"pindexOldTip->GetHeight().%d > notarizedht %d && pindexFork->GetHeight().%d is < notarizedht %d, so ignore it\n",(int32_t)pindexFork->GetHeight(),notarizedht,(int32_t)pindexOldTip->GetHeight(),notarizedht);
|
fprintf(stderr,"pindexOldTip->GetHeight().%d > notarizedht %d && pindexFork->GetHeight().%d is < notarizedht %d, so ignore it\n",(int32_t)pindexOldTip->GetHeight(),notarizedht,(int32_t)pindexFork->GetHeight(),notarizedht);
|
||||||
return state.DoS(100, error("ActivateBestChainStep(): pindexOldTip->GetHeight().%d > notarizedht %d && pindexFork->GetHeight().%d is < notarizedht %d, so ignore it",(int32_t)pindexFork->GetHeight(),notarizedht,(int32_t)pindexOldTip->GetHeight(),notarizedht),
|
return state.DoS(100, error("ActivateBestChainStep(): pindexOldTip->GetHeight().%d > notarizedht %d && pindexFork->GetHeight().%d is < notarizedht %d, so ignore it",(int32_t)pindexOldTip->GetHeight(),notarizedht,(int32_t)pindexFork->GetHeight(),notarizedht),
|
||||||
REJECT_INVALID, "past-notarized-height");
|
REJECT_INVALID, "past-notarized-height");
|
||||||
}
|
}
|
||||||
// - On ChainDB initialization, pindexOldTip will be null, so there are no removable blocks.
|
// - On ChainDB initialization, pindexOldTip will be null, so there are no removable blocks.
|
||||||
|
|||||||
Reference in New Issue
Block a user