diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index d30fb8987..e3a655d18 100755 --- a/iguana/dpow/dpow_network.c +++ b/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); } -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]; opretlen += iguana_rwbignum(rwflag,&opret[opretlen],sizeof(*hashmsg),hashmsg->bytes); 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); if ( rwflag != 0 ) diff --git a/iguana/dpow/dpow_tx.c b/iguana/dpow/dpow_tx.c index 30742f684..88983c70b 100755 --- a/iguana/dpow/dpow_tx.c +++ b/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; satoshis = 0; 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); if ( opretlen < 0xfd ) 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; m = 0; - printf("dpow_rawtxsign src_or_dest.%d %s\n",src_or_dest,coin->symbol); ep = &bp->notaries[myind]; cp = (src_or_dest != 0) ? &bp->notaries[myind].dest : &bp->notaries[myind].src; if ( (jsonstr= dpow_signrawtransaction(myinfo,coin,rawtx,vins)) != 0 )