Tweaks
This commit is contained in:
@@ -374,6 +374,7 @@ int32_t NSPV_rwbroadcastresp(int32_t rwflag,uint8_t *serialized,struct NSPV_broa
|
||||
int32_t len = 0;
|
||||
len += iguana_rwbignum(rwflag,&serialized[len],sizeof(ptr->txid),(uint8_t *)&ptr->txid);
|
||||
len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->retcode),&ptr->retcode);
|
||||
fprintf(stderr,"broadcastresp[%d]\n",len);
|
||||
return(len);
|
||||
}
|
||||
|
||||
|
||||
@@ -197,12 +197,11 @@ uint8_t *NSPV_getrawtx(uint256 &hashBlock,uint16_t *txlenp,uint256 txid)
|
||||
|
||||
int32_t NSPV_sendrawtransaction(struct NSPV_broadcastresp *ptr,uint8_t *data,int32_t n)
|
||||
{
|
||||
CTransaction tx; std::string rawtx;
|
||||
CTransaction tx; std::vector<uint8_t> rawdata;
|
||||
ptr->retcode = 0;
|
||||
rawtx.resize(n*2+1);
|
||||
init_hexbytes_noT((char *)rawtx.data(),data,n);
|
||||
//fprintf(stderr,"rawtx.(%s)\n",rawtx.c_str());
|
||||
if ( DecodeHexTx(tx,rawtx) != 0 )
|
||||
rawdata.resize(n);
|
||||
memcpy(&rawdata[0],data,n);
|
||||
if ( DecodeHexTx(tx,rawdata.GetHex()) != 0 )
|
||||
{
|
||||
LOCK(cs_main);
|
||||
ptr->txid = tx.GetHash();
|
||||
@@ -494,6 +493,7 @@ void komodo_nSPVreq(CNode *pfrom,std::vector<uint8_t> request) // received a req
|
||||
{
|
||||
response.resize(1 + slen);
|
||||
response[0] = NSPV_BROADCASTRESP;
|
||||
fprintf(stderr,"slen.%d\n");
|
||||
if ( NSPV_rwbroadcastresp(1,&response[1],&B) == slen )
|
||||
{
|
||||
pfrom->PushMessage("nSPV",response);
|
||||
|
||||
@@ -401,6 +401,7 @@ UniValue NSPV_broadcast(char *hex)
|
||||
}
|
||||
free(msg);
|
||||
memset(&B,0,sizeof(B));
|
||||
B.retcode = -2;
|
||||
return(NSPV_broadcast_json(&B));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user