jl777 8 years ago
parent
commit
985ad62475
  1. 4
      iguana/dpow/dpow_network.c
  2. 5
      iguana/dpow/dpow_tx.c

4
iguana/dpow/dpow_network.c

@ -165,12 +165,12 @@ int32_t dpow_opreturnscript(uint8_t *script,uint8_t *opret,int32_t opretlen)
return(opretlen + offset); return(opretlen + offset);
} }
int32_t dpow_rwopret(int32_t rwflag,uint8_t *opret,bits256 *hashmsg,int32_t *heightmsgp,bits256 *desttxid,char *src,struct dpow_block *bp) int32_t dpow_rwopret(int32_t rwflag,uint8_t *opret,bits256 *hashmsg,int32_t *heightmsgp,bits256 *desttxid,char *src,struct dpow_block *bp,int32_t src_or_dest)
{ {
int32_t i,opretlen = 0; bits256 beacon,beacons[DPOW_MAXRELAYS]; int32_t i,opretlen = 0; bits256 beacon,beacons[DPOW_MAXRELAYS];
opretlen += iguana_rwbignum(rwflag,&opret[opretlen],sizeof(*hashmsg),hashmsg->bytes); opretlen += iguana_rwbignum(rwflag,&opret[opretlen],sizeof(*hashmsg),hashmsg->bytes);
opretlen += iguana_rwnum(rwflag,&opret[opretlen],sizeof(*heightmsgp),(uint32_t *)heightmsgp); opretlen += iguana_rwnum(rwflag,&opret[opretlen],sizeof(*heightmsgp),(uint32_t *)heightmsgp);
if ( bits256_nonz(*desttxid) != 0 ) if ( src_or_dest == 0 )
{ {
opretlen += iguana_rwbignum(rwflag,&opret[opretlen],sizeof(*desttxid),desttxid->bytes); opretlen += iguana_rwbignum(rwflag,&opret[opretlen],sizeof(*desttxid),desttxid->bytes);
if ( rwflag != 0 ) if ( rwflag != 0 )

5
iguana/dpow/dpow_tx.c

@ -121,7 +121,9 @@ bits256 dpow_notarytx(char *signedtx,int32_t *numsigsp,int32_t isPoS,struct dpow
serialized[len++] = CHECKSIG; serialized[len++] = CHECKSIG;
satoshis = 0; satoshis = 0;
len += iguana_rwnum(1,&serialized[len],sizeof(satoshis),&satoshis); len += iguana_rwnum(1,&serialized[len],sizeof(satoshis),&satoshis);
opretlen = dpow_rwopret(1,opret,&bp->hashmsg,&bp->height,&bp->desttxid,src,bp); if ( src_or_dest != 0 )
opretlen = dpow_rwopret(1,opret,&bp->hashmsg,&bp->height,&bp->desttxid,src,bp,src_or_dest);
else opretlen = dpow_rwopret(1,opret,&bp->hashmsg,&bp->height,&bp->srctxid,src,bp,src_or_dest);
opretlen = dpow_opreturnscript(data,opret,opretlen); opretlen = dpow_opreturnscript(data,opret,opretlen);
if ( opretlen < 0xfd ) if ( opretlen < 0xfd )
serialized[len++] = opretlen; serialized[len++] = opretlen;
@ -180,7 +182,6 @@ void dpow_rawtxsign(struct supernet_info *myinfo,struct iguana_info *coin,struct
{ {
int32_t j,m=0,retval=-1; char *jsonstr,*signedtx,*rawtx2,*sigstr; cJSON *signobj,*sobj,*txobj2,*item,*vin; bits256 srchash; struct dpow_entry *ep; struct dpow_coinentry *cp; int32_t j,m=0,retval=-1; char *jsonstr,*signedtx,*rawtx2,*sigstr; cJSON *signobj,*sobj,*txobj2,*item,*vin; bits256 srchash; struct dpow_entry *ep; struct dpow_coinentry *cp;
m = 0; m = 0;
printf("dpow_rawtxsign src_or_dest.%d %s\n",src_or_dest,coin->symbol);
ep = &bp->notaries[myind]; ep = &bp->notaries[myind];
cp = (src_or_dest != 0) ? &bp->notaries[myind].dest : &bp->notaries[myind].src; cp = (src_or_dest != 0) ? &bp->notaries[myind].dest : &bp->notaries[myind].src;
if ( (jsonstr= dpow_signrawtransaction(myinfo,coin,rawtx,vins)) != 0 ) if ( (jsonstr= dpow_signrawtransaction(myinfo,coin,rawtx,vins)) != 0 )

Loading…
Cancel
Save