jl777 7 years ago
parent
commit
f2b6c7dcfe
  1. 5
      iguana/dpow/dpow_fsm.c
  2. 2
      iguana/dpow/dpow_rpc.c

5
iguana/dpow/dpow_fsm.c

@ -256,6 +256,11 @@ bits256 dpow_calcMoM(uint32_t *MoMdepthp,struct supernet_info *myinfo,struct igu
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 )
{ {
if ( dpow_hasnotarization(myinfo,coin,blockjson) > 0 )
{
free_json(blockjson);
break;
}
merkle = jbits256(blockjson,"merkleroot"); merkle = jbits256(blockjson,"merkleroot");
free_json(blockjson); free_json(blockjson);
if ( bits256_nonz(merkle) != 0 ) if ( bits256_nonz(merkle) != 0 )

2
iguana/dpow/dpow_rpc.c

@ -759,6 +759,8 @@ int32_t dpow_getchaintip(struct supernet_info *myinfo,bits256 *merklerootp,bits2
if ( (height= juint(json,"height")) != 0 && (*blocktimep= juint(json,"time")) != 0 ) if ( (height= juint(json,"height")) != 0 && (*blocktimep= juint(json,"time")) != 0 )
{ {
*merklerootp = jbits256(json,"merkleroot"); *merklerootp = jbits256(json,"merkleroot");
if ( bits256_nonz(*merklerootp) == 0 )
printf("block has no merkle? (%s)\n",jprint(json,0));
coin->lastbestheight = height; coin->lastbestheight = height;
if ( height > coin->longestchain ) if ( height > coin->longestchain )
coin->longestchain = height; coin->longestchain = height;

Loading…
Cancel
Save