@ -620,8 +620,8 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr
notarized = 1 ;
if ( strcmp ( " PIZZA " , ccdata . symbol ) = = 0 | | strncmp ( " TXSCL " , ccdata . symbol , 5 ) = = 0 )
notarized = 1 ;
//if ( 0 && opretlen != 149 )
// printf(" [%s].%d (%s) matched.%d i.%d j.%d notarized.%d %llx opretlen.%d len.%d offset.%d opoffset.%d\n",ASSETCHAINS_SYMBOL,height,ccdata.symbol,matched,i,j,notarized,(long long)signedmask,opretlen,len,offset,opoffset);
if ( 0 & & opretlen ! = 149 )
printf ( " [%s].%d (%s) matched.%d i.%d j.%d notarized.%d %llx opretlen.%d len.%d offset.%d opoffset.%d \n " , ASSETCHAINS_SYMBOL , height , ccdata . symbol , matched , i , j , notarized , ( long long ) signedmask , opretlen , len , offset , opoffset ) ;
len + = iguana_rwbignum ( 0 , & scriptbuf [ len ] , 32 , ( uint8_t * ) & srchash ) ;
len + = iguana_rwnum ( 0 , & scriptbuf [ len ] , sizeof ( * notarizedheightp ) , ( uint8_t * ) notarizedheightp ) ;
if ( matched ! = 0 )
@ -685,8 +685,8 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr
else
{
komodo_rwccdata ( ASSETCHAINS_SYMBOL , 1 , & ccdata , & MoMoMdata ) ;
//if ( matched != 0 )
// printf("[%s] matched.%d VALID (%s) MoM.%s [%d] CCid.%u\n",ASSETCHAINS_SYMBOL,matched,ccdata.symbol,MoM.ToString().c_str(),MoMdepth&0xffff,(MoMdepth>>16)&0xffff);
if ( matched ! = 0 )
printf ( " [%s] matched.%d VALID (%s) MoM.%s [%d] CCid.%u \n " , ASSETCHAINS_SYMBOL , matched , ccdata . symbol , MoM . ToString ( ) . c_str ( ) , MoMdepth & 0xffff , ( MoMdepth > > 16 ) & 0xffff ) ;
}
if ( MoMoMdata . pairs ! = 0 )
free ( MoMoMdata . pairs ) ;
@ -706,8 +706,8 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr
sp - > MoMdepth = MoMdepth ;
}
komodo_stateupdate ( height , 0 , 0 , 0 , zero , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , sp - > MoM , sp - > MoMdepth ) ;
//if ( ASSETCHAINS_SYMBOL[0] != 0 )
// printf(" [%s] ht.%d NOTARIZED.%d %s.%s %sTXID.%s lens.(%d %d) MoM.%s %d\n",ASSETCHAINS_SYMBOL,height,*notarizedheightp,ASSETCHAINS_SYMBOL[0]= =0?"KMD":ASSETCHAINS_SYMBOL,srchash.ToString().c_str(),ASSETCHAINS_SYMBOL[0]== 0?"BTC":"KMD",desttxid.ToString().c_str(),opretlen,len,sp ->MoM.ToString().c_str(),sp ->MoMdepth);
if ( ASSETCHAINS_SYMBOL [ 0 ] ! = 0 )
printf ( " [%s] ht.%d NOTARIZED.%d %s.%s %sTXID.%s lens.(%d %d) MoM.%s %d \n " , ASSETCHAINS_SYMBOL , height , * notarizedheightp , ASSETCHAINS_SYMBOL [ 0 ] = = 0 ? " KMD " : ASSETCHAINS_SYMBOL , srchash . ToString ( ) . c_str ( ) , ASSETCHAINS_SYMBOL [ 0 ] = = 0 ? " BTC " : " KMD " , desttxid . ToString ( ) . c_str ( ) , opretlen , len , sp - > MoM . ToString ( ) . c_str ( ) , sp - > MoMdepth ) ;
if ( ASSETCHAINS_SYMBOL [ 0 ] = = 0 )
{
if ( signedfp = = 0 )
@ -733,8 +733,8 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr
}
}
}
} //else if ( opretlen != 149 && height > 600000 && matched != 0 )
//printf(" %s validated.%d notarized.%d %llx reject ht.%d NOTARIZED.%d prev.%d %s.%s DESTTXID.%s len.%d opretlen.%d\n",ccdata.symbol,validated,notarized,(long long)signedmask,height,*notarizedheightp,sp ->NOTARIZED_HEIGHT,ASSETCHAINS_SYMBOL[0]= =0?"KMD":ASSETCHAINS_SYMBOL,srchash.ToString().c_str(),desttxid.ToString().c_str(),len,opretlen);
} else if ( opretlen ! = 149 & & height > 600000 & & matched ! = 0 )
printf ( " %s validated.%d notarized.%d %llx reject ht.%d NOTARIZED.%d prev.%d %s.%s DESTTXID.%s len.%d opretlen.%d \n " , ccdata . symbol , validated , notarized , ( long long ) signedmask , height , * notarizedheightp , sp - > NOTARIZED_HEIGHT , ASSETCHAINS_SYMBOL [ 0 ] = = 0 ? " KMD " : ASSETCHAINS_SYMBOL , srchash . ToString ( ) . c_str ( ) , desttxid . ToString ( ) . c_str ( ) , len , opretlen ) ;
}
else if ( matched ! = 0 & & i = = 0 & & j = = 1 & & opretlen = = 149 )
{
@ -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\n",ASSETCHAINS_SYMBOL);
printf ( " ERA 0 SKIP %s \n " , ASSETCHAINS_SYMBOL ) ;
continue ;
}
txhash = block . vtx [ i ] . GetHash ( ) ;
@ -856,7 +856,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
printf ( " %02x " , scriptPubKey [ k ] ) ;
printf ( " scriptPubKey doesnt match any notary vini.%d of %d \n " , j , numvins ) ;
}
} //else printf("cant get scriptPubKey for ht.%d txi.%d vin.%d\n",height,i,j);
} else printf ( " cant get scriptPubKey for ht.%d txi.%d vin.%d \n " , height , i , j ) ;
}
numvalid = bitweight ( signedmask ) ;
if ( ( ( height < 90000 | | ( signedmask & 1 ) ! = 0 ) & & numvalid > = KOMODO_MINRATIFY ) | |
@ -880,7 +880,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
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);
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 ;
}
@ -917,20 +917,20 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
{
for ( k = 0 ; k < len ; k + + )
printf ( " %02x " , scriptbuf [ k ] ) ;
//printf(" <- notaryid.%d ht.%d i.%d j.%d numvouts.%d numvins.%d voutmask.%llx txid.(%s)\n",notaryid,height,i,j,numvouts,numvins,(long long)voutmask,txhash.ToString().c_str());
printf ( " <- notaryid.%d ht.%d i.%d j.%d numvouts.%d numvins.%d voutmask.%llx txid.(%s) \n " , notaryid , height , i , j , numvouts , numvins , ( long long ) voutmask , txhash . ToString ( ) . c_str ( ) ) ;
}
}
}
if ( IS_KOMODO_NOTARY ! = 0 & & ASSETCHAINS_SYMBOL [ 0 ] = = 0 )
printf ( " ) " ) ;
if ( 0 & & ASSETCHAINS_SYMBOL [ 0 ] = = 0 )
//printf(" [%s] ht.%d txi.%d signedmask.%llx numvins.%d numvouts.%d notarized.%d special.%d isratification.%d\n",ASSETCHAINS_SYMBOL,height,i,(long long)signedmask,numvins,numvouts,notarized,specialtx,isratification);
printf ( " [%s] ht.%d txi.%d signedmask.%llx numvins.%d numvouts.%d notarized.%d special.%d isratification.%d \n " , ASSETCHAINS_SYMBOL , height , i , ( long long ) signedmask , numvins , numvouts , notarized , specialtx , isratification ) ;
if ( notarized ! = 0 & & ( notarizedheight ! = 0 | | specialtx ! = 0 ) )
{
if ( isratification ! = 0 )
{
//printf(" %s NOTARY SIGNED.%llx numvins.%d ht.%d txi.%d notaryht.%d specialtx.%d\n",ASSETCHAINS_SYMBOL,(long long)signedmask,numvins,height,i,notarizedheight,specialtx);
//printf(" ht.%d specialtx.%d isratification.%d numvouts.%d signed.%llx numnotaries.%d\n",height,specialtx,isratification,numvouts,(long long)signedmask,numnotaries);
printf ( " %s NOTARY SIGNED.%llx numvins.%d ht.%d txi.%d notaryht.%d specialtx.%d \n " , ASSETCHAINS_SYMBOL , ( long long ) signedmask , numvins , height , i , notarizedheight , specialtx ) ;
printf ( " ht.%d specialtx.%d isratification.%d numvouts.%d signed.%llx numnotaries.%d \n " , height , specialtx , isratification , numvouts , ( long long ) signedmask , numnotaries ) ;
}
if ( specialtx ! = 0 & & isratification ! = 0 & & numvouts > 2 )
{
@ -959,8 +959,8 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
{
memset ( & txhash , 0 , sizeof ( txhash ) ) ;
komodo_stateupdate ( height , pubkeys , numvalid , 0 , txhash , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , zero , 0 ) ;
//printf(" RATIFIED! >>>>>>>>>> new notaries.%d newheight.%d from height.%d\n",numvalid,(((height+KOMODO_ELECTION_GAP/ 2)/ KOMODO_ELECTION_GAP)+1)*KOMODO_ELECTION_GAP,height);
} //else printf("signedmask.%llx numvalid.%d wt.%d numnotaries.%d\n",(long long)signedmask,numvalid,bitweight(signedmask),numnotaries);
printf ( " RATIFIED! >>>>>>>>>> new notaries.%d newheight.%d from height.%d \n " , numvalid , ( ( ( height + KOMODO_ELECTION_GAP / 2 ) / KOMODO_ELECTION_GAP ) + 1 ) * KOMODO_ELECTION_GAP , height ) ;
} else printf ( " signedmask.%llx numvalid.%d wt.%d numnotaries.%d \n " , ( long long ) signedmask , numvalid , bitweight ( signedmask ) , numnotaries ) ;
}
}
}