Browse Source

Test

pull/4/head
jl777 7 years ago
parent
commit
f1d6fb9b92
  1. 47
      src/komodo.h

47
src/komodo.h

@ -546,22 +546,22 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr
len += 4;
if ( ASSETCHAINS_SYMBOL[0] != 0 )
printf("[%s] ht.%d NOTARIZED.%d %s.%s %sTXID.%s lens.(%d %d)\n",ASSETCHAINS_SYMBOL,height,*notarizedheightp,ASSETCHAINS_SYMBOL[0]==0?"KMD":ASSETCHAINS_SYMBOL,kmdtxid.ToString().c_str(),ASSETCHAINS_SYMBOL[0]==0?"BTC":"KMD",desttxid.ToString().c_str(),opretlen,len);
if ( signedfp == 0 )
{
char fname[512];
komodo_statefname(fname,ASSETCHAINS_SYMBOL,(char *)"signedmasks");
if ( (signedfp= fopen(fname,"rb+")) == 0 )
signedfp = fopen(fname,"wb");
else fseek(signedfp,0,SEEK_END);
}
if ( signedfp != 0 )
{
fwrite(&height,1,sizeof(height),signedfp);
fwrite(&signedmask,1,sizeof(signedmask),signedfp);
fflush(signedfp);
}
if ( ASSETCHAINS_SYMBOL[0] == 0 )
{
if ( signedfp == 0 )
{
char fname[512];
komodo_statefname(fname,ASSETCHAINS_SYMBOL,(char *)"signedmasks");
if ( (signedfp= fopen(fname,"rb+")) == 0 )
signedfp = fopen(fname,"wb");
else fseek(signedfp,0,SEEK_END);
}
if ( signedfp != 0 )
{
fwrite(&height,1,sizeof(height),signedfp);
fwrite(&signedmask,1,sizeof(signedmask),signedfp);
fflush(signedfp);
}
if ( opretlen > len && scriptbuf[len] == 'A' )
{
//for (i=0; i<opretlen-len; i++)
@ -692,8 +692,25 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
(numvalid >= KOMODO_MINRATIFY && ASSETCHAINS_SYMBOL[0] != 0) ||
numvalid > (numnotaries/5)) )
{
if ( height > 500000 || ASSETCHAINS_SYMBOL[0] != 0 )
if ( ASSETCHAINS_SYMBOL[0] != 0 )
{
static FILE *signedfp;
if ( signedfp == 0 )
{
char fname[512];
komodo_statefname(fname,ASSETCHAINS_SYMBOL,(char *)"signedmasks");
if ( (signedfp= fopen(fname,"rb+")) == 0 )
signedfp = fopen(fname,"wb");
else fseek(signedfp,0,SEEK_END);
}
if ( signedfp != 0 )
{
fwrite(&height,1,sizeof(height),signedfp);
fwrite(&signedmask,1,sizeof(signedmask),signedfp);
fflush(signedfp);
}
printf("[%s] ht.%d txi.%d signedmask.%llx numvins.%d numvouts.%d <<<<<<<<<<< notarized\n",ASSETCHAINS_SYMBOL,height,i,(long long)signedmask,numvins,numvouts);
}
notarized = 1;
}
if ( NOTARY_PUBKEY33[0] != 0 && ASSETCHAINS_SYMBOL[0] == 0 )

Loading…
Cancel
Save