diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index c2976f66a..a6eb17b7e 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -162,7 +162,7 @@ int32_t dpow_checkutxo(struct supernet_info *myinfo,struct dpow_info *dp,struct uint32_t Numallocated; -int32_t dpow_txhasnotarization(struct supernet_info *myinfo,struct iguana_info *coin,bits256 txid) +int32_t dpow_txhasnotarization(struct supernet_info *myinfo,struct iguana_info *coin,bits256 txid,int32_t height) { cJSON *txobj,*vins,*vin,*vouts,*vout,*spentobj,*sobj; char *hexstr; uint8_t script[35]; bits256 spenttxid; uint64_t notarymask; int32_t i,j,numnotaries,len,spentvout,numvins,numvouts,hasnotarization = 0; if ( (txobj= dpow_gettransaction(myinfo,coin,txid)) != 0 ) @@ -214,7 +214,7 @@ int32_t dpow_txhasnotarization(struct supernet_info *myinfo,struct iguana_info * { if ( numnotaries >= DPOW_MIN_ASSETCHAIN_SIGS ) hasnotarization = 1; - printf("numnotaries.%d %s hasnotarization.%d\n",numnotaries,coin->symbol,hasnotarization); + printf("numnotaries.%d %s hasnotarization.%d ht.%d\n",numnotaries,coin->symbol,hasnotarization,height); } } } @@ -223,7 +223,7 @@ int32_t dpow_txhasnotarization(struct supernet_info *myinfo,struct iguana_info * return(hasnotarization); } -int32_t dpow_hasnotarization(struct supernet_info *myinfo,struct iguana_info *coin,cJSON *blockjson) +int32_t dpow_hasnotarization(struct supernet_info *myinfo,struct iguana_info *coin,cJSON *blockjson,int32_t ht) { int32_t i,n,hasnotarization = 0; bits256 txid; cJSON *txarray; if ( (txarray= jarray(&n,blockjson,"tx")) != 0 ) @@ -231,7 +231,7 @@ int32_t dpow_hasnotarization(struct supernet_info *myinfo,struct iguana_info *co for (i=0; i 0 ) + if ( dpow_hasnotarization(myinfo,coin,blockjson,ht) > 0 ) { free_json(blockjson); break; diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index ce312d50a..85b0367b1 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -87,9 +87,9 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he { if ( (blockjson= dpow_getblock(myinfo,coin,hash)) != 0 ) { - if ( dpow_hasnotarization(myinfo,coin,blockjson) <= 0 ) + height = jint(blockjson,"height"); + if ( dpow_hasnotarization(myinfo,coin,blockjson,height) <= 0 ) { - height = jint(blockjson,"height"); blocktime = juint(blockjson,"time"); free_json(blockjson); if ( height > 0 && blocktime > 0 )