|
@ -257,7 +257,7 @@ int32_t dpow_txhasnotarization(uint64_t *signedmaskp,int32_t *nothtp,struct supe |
|
|
if ( numnotaries >= DPOW_MIN_ASSETCHAIN_SIGS ) |
|
|
if ( numnotaries >= DPOW_MIN_ASSETCHAIN_SIGS ) |
|
|
{ |
|
|
{ |
|
|
hasnotarization = 1; |
|
|
hasnotarization = 1; |
|
|
*nothtp = height - 10; |
|
|
*nothtp = 0; |
|
|
if ( (vouts= jarray(&numvouts,txobj,"vout")) != 0 ) |
|
|
if ( (vouts= jarray(&numvouts,txobj,"vout")) != 0 ) |
|
|
{ |
|
|
{ |
|
|
bits256 blockhash,txid,MoM; uint32_t MoMdepth; char symbol[65],str[65],str2[65],str3[65]; |
|
|
bits256 blockhash,txid,MoM; uint32_t MoMdepth; char symbol[65],str[65],str2[65],str3[65]; |
|
@ -268,9 +268,9 @@ int32_t dpow_txhasnotarization(uint64_t *signedmaskp,int32_t *nothtp,struct supe |
|
|
decode_hex(script,len,hexstr); |
|
|
decode_hex(script,len,hexstr); |
|
|
if ( dpow_opreturn_parsesrc(&blockhash,nothtp,&txid,symbol,&MoM,&MoMdepth,script,len) > 0 ) |
|
|
if ( dpow_opreturn_parsesrc(&blockhash,nothtp,&txid,symbol,&MoM,&MoMdepth,script,len) > 0 ) |
|
|
{ |
|
|
{ |
|
|
printf("%s.%d notarizationht.%d %s -> %s MoM.%s [%d]\n",symbol,height,*nothtp,bits256_str(str,blockhash),bits256_str(str2,txid),bits256_str(str3,MoM),MoMdepth); |
|
|
if ( bits256_nonz(MoM) == 0 || MoMdepth == 0 || *nothtp >= height || *nothtp < 0 ) |
|
|
if ( bits256_nonz(MoM) == 0 || MoMdepth == 0 ) |
|
|
|
|
|
*nothtp = 0; |
|
|
*nothtp = 0; |
|
|
|
|
|
printf("%s.%d notarizationht.%d %s -> %s MoM.%s [%d]\n",symbol,height,*nothtp,bits256_str(str,blockhash),bits256_str(str2,txid),bits256_str(str3,MoM),MoMdepth); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -319,7 +319,7 @@ bits256 dpow_calcMoM(uint32_t *MoMdepthp,struct supernet_info *myinfo,struct igu |
|
|
ht = height - MoMdepth; |
|
|
ht = height - MoMdepth; |
|
|
while ( MoMdepth < maxdepth && ht > breakht && ht > 0 ) |
|
|
while ( MoMdepth < maxdepth && ht > breakht && ht > 0 ) |
|
|
{ |
|
|
{ |
|
|
//fprintf(stderr,"%s.%d ",coin->symbol,ht);
|
|
|
fprintf(stderr,"%s.%d ",coin->symbol,ht); |
|
|
blockhash = dpow_getblockhash(myinfo,coin,ht); |
|
|
blockhash = dpow_getblockhash(myinfo,coin,ht); |
|
|
if ( (blockjson= dpow_getblock(myinfo,coin,blockhash)) != 0 ) |
|
|
if ( (blockjson= dpow_getblock(myinfo,coin,blockhash)) != 0 ) |
|
|
{ |
|
|
{ |
|
@ -327,7 +327,7 @@ bits256 dpow_calcMoM(uint32_t *MoMdepthp,struct supernet_info *myinfo,struct igu |
|
|
{ |
|
|
{ |
|
|
breakht = notht; |
|
|
breakht = notht; |
|
|
//free_json(blockjson);
|
|
|
//free_json(blockjson);
|
|
|
//printf("%s has notarization at %d for breakht.%d\n",coin->symbol,ht,notht);
|
|
|
printf("%s has notarization at %d for breakht.%d\n",coin->symbol,ht,notht); |
|
|
} |
|
|
} |
|
|
merkle = jbits256(blockjson,"merkleroot"); |
|
|
merkle = jbits256(blockjson,"merkleroot"); |
|
|
free_json(blockjson); |
|
|
free_json(blockjson); |
|
|