This commit is contained in:
jl777
2019-07-05 23:45:23 -11:00
parent f1e69bfde2
commit dbf4d76ac7
2 changed files with 3 additions and 3 deletions

View File

@@ -201,7 +201,7 @@ int32_t NSPV_sendrawtransaction(struct NSPV_broadcastresp *ptr,uint8_t *data,int
ptr->retcode = 0;
rawtx.resize(n*2+1);
init_hexbytes_noT((char *)rawtx.data(),data,n);
fprintf(stderr,"rawtx.(%s)\n",rawtx.c_str());
//fprintf(stderr,"rawtx.(%s)\n",rawtx.c_str());
if ( DecodeHexTx(tx,rawtx) != 0 )
{
ptr->txid = tx.GetHash();

View File

@@ -378,10 +378,10 @@ UniValue NSPV_broadcast(char *hex)
uint8_t *msg,*data; bits256 _txid; uint256 txid; uint16_t n; int32_t i,len = 0; struct NSPV_broadcastresp B;
n = (int32_t)strlen(hex) >> 1;
data = (uint8_t *)malloc(n);
decode_hex(tx,n,hex);
decode_hex(data,n,hex);
_txid = bits256_doublesha256(0,data,n);
memcpy(&txid,&_txid,sizeof(txid));
msg = malloc(1 + sizeof(txid) + sizeof(n) + n);
msg = (uint8_t *)malloc(1 + sizeof(txid) + sizeof(n) + n);
msg[len++] = NSPV_BROADCAST;
len += iguana_rwbignum(1,&msg[len],sizeof(txid),(uint8_t *)&txid);
len += iguana_rwnum(1,&msg[len],sizeof(n),&n);