|
@ -305,7 +305,7 @@ cJSON *dpow_vins(struct iguana_info *coin,struct dpow_block *bp,int8_t bestk,uin |
|
|
vins = cJSON_CreateArray(); |
|
|
vins = cJSON_CreateArray(); |
|
|
for (j=0; j<bp->numnotaries; j++) |
|
|
for (j=0; j<bp->numnotaries; j++) |
|
|
{ |
|
|
{ |
|
|
k = DPOW_MODIND(bp,j); |
|
|
k = j;//DPOW_MODIND(bp,j);
|
|
|
if ( ((1LL << k) & bestmask) != 0 ) |
|
|
if ( ((1LL << k) & bestmask) != 0 ) |
|
|
{ |
|
|
{ |
|
|
ep = &bp->notaries[k]; |
|
|
ep = &bp->notaries[k]; |
|
@ -341,7 +341,7 @@ cJSON *dpow_vins(struct iguana_info *coin,struct dpow_block *bp,int8_t bestk,uin |
|
|
jaddi(vins,item); |
|
|
jaddi(vins,item); |
|
|
//printf("height.%d mod.%d VINI.%d <- i.%d j.%d\n",height,height % numnotaries,m,i,j);
|
|
|
//printf("height.%d mod.%d VINI.%d <- i.%d j.%d\n",height,height % numnotaries,m,i,j);
|
|
|
m++; |
|
|
m++; |
|
|
if ( m == bp->minsigs && k == bestk ) |
|
|
if ( m == bp->minsigs )//&& k == bestk )
|
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
@ -415,7 +415,7 @@ int32_t dpow_signedtxgen(struct supernet_info *myinfo,struct dpow_info *dp,struc |
|
|
if ( (vins= dpow_vins(coin,bp,bestk,bestmask,1,src_or_dest,useratified)) != 0 ) |
|
|
if ( (vins= dpow_vins(coin,bp,bestk,bestmask,1,src_or_dest,useratified)) != 0 ) |
|
|
{ |
|
|
{ |
|
|
txid = dpow_notarytx(rawtx,&numsigs,coin->chain->isPoS,bp,bestk,bestmask,0,src_or_dest,bp->numratified!=0?bp->ratified_pubkeys:0,useratified*bp->numratified); |
|
|
txid = dpow_notarytx(rawtx,&numsigs,coin->chain->isPoS,bp,bestk,bestmask,0,src_or_dest,bp->numratified!=0?bp->ratified_pubkeys:0,useratified*bp->numratified); |
|
|
char str[65]; printf("signedtxgen %s src_or_dest.%d (%d %llx) useratified.%d raw.(%s)\n",bits256_str(str,txid),src_or_dest,bestk,(long long)bestmask,useratified,rawtx); |
|
|
//char str[65]; printf("signedtxgen %s src_or_dest.%d (%d %llx) useratified.%d raw.(%s)\n",bits256_str(str,txid),src_or_dest,bestk,(long long)bestmask,useratified,rawtx);
|
|
|
if ( bits256_nonz(txid) != 0 && rawtx[0] != 0 ) // send tx to share utxo set
|
|
|
if ( bits256_nonz(txid) != 0 && rawtx[0] != 0 ) // send tx to share utxo set
|
|
|
{ |
|
|
{ |
|
|
if ( useratified != 0 ) |
|
|
if ( useratified != 0 ) |
|
@ -424,15 +424,12 @@ int32_t dpow_signedtxgen(struct supernet_info *myinfo,struct dpow_info *dp,struc |
|
|
{ |
|
|
{ |
|
|
if ( (signobj= cJSON_Parse(jsonstr)) != 0 ) |
|
|
if ( (signobj= cJSON_Parse(jsonstr)) != 0 ) |
|
|
{ |
|
|
{ |
|
|
printf("signobj\n"); |
|
|
|
|
|
if ( ((signedtx= jstr(signobj,"hex")) != 0 || (signedtx= jstr(signobj,"result")) != 0) && (rawtx2= dpow_decoderawtransaction(myinfo,coin,signedtx)) != 0 ) |
|
|
if ( ((signedtx= jstr(signobj,"hex")) != 0 || (signedtx= jstr(signobj,"result")) != 0) && (rawtx2= dpow_decoderawtransaction(myinfo,coin,signedtx)) != 0 ) |
|
|
{ |
|
|
{ |
|
|
printf("rawtx2\n"); |
|
|
|
|
|
if ( (txobj2= cJSON_Parse(rawtx2)) != 0 ) |
|
|
if ( (txobj2= cJSON_Parse(rawtx2)) != 0 ) |
|
|
{ |
|
|
{ |
|
|
if ( (vin= jarray(&m,txobj2,"vin")) != 0 ) |
|
|
if ( (vin= jarray(&m,txobj2,"vin")) != 0 ) |
|
|
{ |
|
|
{ |
|
|
printf("vin[%d]\n",m); |
|
|
|
|
|
for (j=0; j<m; j++) |
|
|
for (j=0; j<m; j++) |
|
|
{ |
|
|
{ |
|
|
item = jitem(vin,j); |
|
|
item = jitem(vin,j); |
|
|