update
This commit is contained in:
14
src/hush.h
14
src/hush.h
@@ -704,7 +704,7 @@ int32_t hush_voutupdate(bool fJustCheck,int32_t *isratificationp,int32_t notaryi
|
||||
printf("[%s] ht.%d NOTARIZED.%d %s.%s %sTXID.%s lens.(%d %d) MoM.%s %d\n",SMART_CHAIN_SYMBOL,height,sp->NOTARIZED_HEIGHT,SMART_CHAIN_SYMBOL,srchash.ToString().c_str(),"HUSH",desttxid.ToString().c_str(),opretlen,len,sp->MoM.ToString().c_str(),sp->MoMdepth);
|
||||
|
||||
} //else if ( fJustCheck )
|
||||
// return (-3); // if the notarisation is only invalid because its out of order it cannot be mined in a block with a valid one!
|
||||
// return (-3); // if the notarization is only invalid because its out of order it cannot be mined in a block with a valid one!
|
||||
} 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,SMART_CHAIN_SYMBOL,srchash.ToString().c_str(),desttxid.ToString().c_str(),len,opretlen);
|
||||
}
|
||||
@@ -764,7 +764,7 @@ int32_t hush_notarycmp(uint8_t *scriptPubKey,int32_t scriptlen,uint8_t pubkeys[6
|
||||
int32_t hush_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block)
|
||||
{
|
||||
static int32_t hwmheight;
|
||||
std::vector<int32_t> notarisations;
|
||||
std::vector<int32_t> notarizations;
|
||||
uint64_t signedmask,voutmask; char symbol[HUSH_SMART_CHAIN_MAXLEN],dest[HUSH_SMART_CHAIN_MAXLEN]; struct hush_state *sp;
|
||||
uint8_t scriptbuf[10001],pubkeys[64][33],rmd160[20],scriptPubKey[35]; uint256 zero,btctxid,txhash;
|
||||
int32_t i,j,k,numnotaries,notarized,scriptlen,isratification,nid,numvalid,specialtx,notarizedheight,notaryid,len,numvouts,numvins,height,txn_count;
|
||||
@@ -897,8 +897,8 @@ int32_t hush_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block)
|
||||
notaryid = hush_voutupdate(fJustCheck,&isratification,notaryid,scriptbuf,len,height,txhash,i,j,&voutmask,&specialtx,¬arizedheight,(uint64_t)block.vtx[i].vout[j].nValue,notarized,signedmask,(uint32_t)chainActive.LastTip()->GetBlockTime());
|
||||
if ( fJustCheck && notaryid == -2 )
|
||||
{
|
||||
// We see a valid notarisation here, save its location.
|
||||
notarisations.push_back(i);
|
||||
// We see a valid notarization here, save its location.
|
||||
notarizations.push_back(i);
|
||||
}
|
||||
if ( 0 && i > 0 )
|
||||
{
|
||||
@@ -961,11 +961,11 @@ int32_t hush_connectblock(bool fJustCheck, CBlockIndex *pindex,CBlock& block)
|
||||
//fprintf(stderr,"%s end connect.%d\n",SMART_CHAIN_SYMBOL,pindex->GetHeight());
|
||||
if (fJustCheck)
|
||||
{
|
||||
if ( notarisations.size() == 0 )
|
||||
if ( notarizations.size() == 0 )
|
||||
return(0);
|
||||
if ( notarisations.size() == 1 && notarisations[0] == 1 )
|
||||
if ( notarizations.size() == 1 && notarizations[0] == 1 )
|
||||
return(1);
|
||||
if ( notarisations.size() > 1 || (notarisations.size() == 1 && notarisations[0] != 1) )
|
||||
if ( notarizations.size() > 1 || (notarizations.size() == 1 && notarizations[0] != 1) )
|
||||
return(-1);
|
||||
|
||||
fprintf(stderr,"hush_connectblock: unxexpected behaviour when fJustCheck == true, report bug plz ! \n");
|
||||
|
||||
Reference in New Issue
Block a user