|
|
@ -130,22 +130,27 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint3 |
|
|
|
bestk = data[rlen++]; |
|
|
|
n = data[rlen++]; |
|
|
|
rlen += iguana_rwbignum(0,&data[rlen],sizeof(hashmsg),hashmsg.bytes); |
|
|
|
printf("got ENTRIES src_or_dest.%d bestk.%d numnotaries.%d\n",src_or_dest,bestk,n); |
|
|
|
if ( bits256_cmp(hashmsg,bp->hashmsg) == 0 ) |
|
|
|
{ |
|
|
|
memset(notaries,0,sizeof(notaries)); |
|
|
|
for (i=0; i<64; i++) |
|
|
|
notaries[i].bestk = -1; |
|
|
|
rlen += dpow_rwcoinentrys(0,&data[rlen],src_or_dest,notaries,n,bestk); |
|
|
|
printf("matched hashmsg rlen.%d vs datalen.%d\n",rlen,datalen); |
|
|
|
for (i=0; i<n; i++) |
|
|
|
{ |
|
|
|
ptr = src_or_dest != 0 ? ¬aries[i].dest : ¬aries[i].src; |
|
|
|
refptr = src_or_dest != 0 ? &bp->notaries[i].dest : &bp->notaries[i].src; |
|
|
|
if ( bits256_nonz(ptr->prev_hash) != 0 && bits256_nonz(refptr->prev_hash) == 0 ) |
|
|
|
if ( bits256_nonz(ptr->prev_hash) != 0 ) |
|
|
|
{ |
|
|
|
printf("got utxo.[%d] indirectly\n",i); |
|
|
|
refptr->prev_hash = ptr->prev_hash; |
|
|
|
refptr->prev_vout = ptr->prev_vout; |
|
|
|
bp->recvmask |= (1LL << i); |
|
|
|
if ( bits256_nonz(refptr->prev_hash) == 0 ) |
|
|
|
{ |
|
|
|
printf("got utxo.[%d] indirectly\n",i); |
|
|
|
refptr->prev_hash = ptr->prev_hash; |
|
|
|
refptr->prev_vout = ptr->prev_vout; |
|
|
|
bp->recvmask |= (1LL << i); |
|
|
|
} |
|
|
|
} |
|
|
|
if ( (bestk= notaries[i].bestk) >= 0 ) |
|
|
|
{ |
|
|
|