From 97e4ea3eb55682b77a776f7b759a672e52e260ae Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 9 Oct 2016 12:27:47 -0300 Subject: [PATCH] test --- iguana/iguana_notary.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 2206f441d..e308456c9 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -582,7 +582,7 @@ cJSON *dpow_createtx(struct iguana_info *coin,cJSON **vinsp,struct dpow_entry no int32_t dpow_signedtxgen(struct supernet_info *myinfo,struct dpow_info *dp,struct iguana_info *coin,bits256 *signedtxidp,char *signedtx,uint64_t mask,int32_t lastk,struct dpow_entry notaries[DPOW_MAXRELAYS],int32_t numnotaries,int32_t height,int32_t myind,bits256 hashmsg,bits256 btctxid,uint32_t timestamp) { - int32_t i,j,siglen,m=0,incr,retval=-1; char rawtx[16384],coinaddr,*jsonstr,*rawtx2,*sigstr; cJSON *txobj,*signobj,*sobj,*txobj2,*vins,*item,*vin; uint8_t data[128]; bits256 txid,srchash,desthash; uint32_t channel; + int32_t i,j,z,siglen,m=0,incr,retval=-1; char rawtx[16384],*jsonstr,*rawtx2,*sigstr; cJSON *txobj,*signobj,*sobj,*txobj2,*vins,*item,*vin; uint8_t data[128]; bits256 txid,srchash,desthash; uint32_t channel; incr = sqrt(numnotaries) + 1; if ( numnotaries < 8 ) incr = 1; @@ -600,9 +600,9 @@ int32_t dpow_signedtxgen(struct supernet_info *myinfo,struct dpow_info *dp,struc { if ( (signobj= cJSON_Parse(jsonstr)) != 0 ) { - printf("dpowsign.(%s)\n",jsonstr); if ( (signedtx= jstr(signobj,"result")) != 0 && (rawtx2= dpow_decoderawtransaction(myinfo,coin,signedtx)) != 0 ) { + printf("dpowsign.(%s)\n",rawtx2); if ( (txobj2= cJSON_Parse(rawtx2)) != 0 ) { if ( (vin= jarray(&m,txobj2,"vin")) != 0 ) @@ -610,9 +610,6 @@ int32_t dpow_signedtxgen(struct supernet_info *myinfo,struct dpow_info *dp,struc for (j=0; j> 1; @@ -623,13 +620,14 @@ int32_t dpow_signedtxgen(struct supernet_info *myinfo,struct dpow_info *dp,struc decode_hex(data+11,siglen,sigstr); for (i=(myind % incr); i0; i--) + { newfifo[i] = fifo[i-1]; + if ( (tip.blockhash.height - newfifo[i].blockhash.height) != i ) + printf("(%d != %d) ",(tip.blockhash.height - newfifo[i].blockhash.height),i); + } newfifo[0] = tip; memcpy(fifo,newfifo,sizeof(newfifo)); for (i=0; i