This commit is contained in:
jl777
2019-07-14 23:34:25 -11:00
parent c0eada0781
commit c4489e98ac
3 changed files with 6 additions and 2 deletions

View File

@@ -105,6 +105,7 @@ int32_t NSPV_rwutxosresp(int32_t rwflag,uint8_t *serialized,struct NSPV_utxosres
len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->total),&ptr->total);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->interest),&ptr->interest);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->nodeheight),&ptr->nodeheight);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->pad32),&ptr->pad32);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->CCflag),&ptr->CCflag);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->skipcount),&ptr->skipcount);
if ( rwflag != 0 )
@@ -162,6 +163,7 @@ int32_t NSPV_rwtxidsresp(int32_t rwflag,uint8_t *serialized,struct NSPV_txidsres
len += NSPV_rwtxidresp(rwflag,&serialized[len],&ptr->txids[i]);
}
len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->nodeheight),&ptr->nodeheight);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->pad32),&ptr->pad32);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->CCflag),&ptr->CCflag);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->skipcount),&ptr->skipcount);
if ( rwflag != 0 )
@@ -174,6 +176,7 @@ int32_t NSPV_rwtxidsresp(int32_t rwflag,uint8_t *serialized,struct NSPV_txidsres
memcpy(ptr->coinaddr,&serialized[len],sizeof(ptr->coinaddr));
len += sizeof(ptr->coinaddr);
}
fprintf(stderr,"rwlen.%d\n",len);
return(len);
}

View File

@@ -73,7 +73,7 @@ struct NSPV_utxosresp
struct NSPV_utxoresp *utxos;
char coinaddr[64];
int64_t total,interest;
int32_t nodeheight,skipcount;
int32_t nodeheight,skipcount,pad32;
uint16_t numutxos,CCflag;
};
@@ -88,7 +88,7 @@ struct NSPV_txidsresp
{
struct NSPV_txidresp *txids;
char coinaddr[64];
int32_t nodeheight,skipcount;
int32_t nodeheight,skipcount,pad32;
uint16_t numtxids,CCflag;
};

View File

@@ -472,6 +472,7 @@ void komodo_nSPVreq(CNode *pfrom,std::vector<uint8_t> request) // received a req
memset(&T,0,sizeof(T));
if ( (slen= NSPV_getaddresstxids(&T,coinaddr,isCC,skipcount)) > 0 )
{
fprintf(stderr,"slen.%d\n",slen);
response.resize(1 + slen);
response[0] = NSPV_TXIDSRESP;
if ( NSPV_rwtxidsresp(1,&response[1],&T) == slen )