Browse Source

Utxo test

beta
jl777 8 years ago
parent
commit
6a4d56a00a
  1. 10
      .gitignore
  2. 9
      iguana/dpow/dpow_rpc.c

10
.gitignore

@ -220,3 +220,13 @@ iguana/confs/630929d976025fafde221c7358eb5805f4359bad3c6b8bd50ad3f6e0a9b5ce78
iguana/confs/5f3283a017c31e52443d61cb43944e2157f7c03eb12d701ebf4a35a695688e1f
iguana/3193054754-2514575257
iguana/DB/SWAPS/2723832060-1788071166
*.alicepayment
*.finished
*.myfee
iguana/DB/SWAPS/3213598586-2281632307

9
iguana/dpow/dpow_rpc.c

@ -772,7 +772,7 @@ int32_t dpow_vini_ismine(struct supernet_info *myinfo,struct dpow_info *dp,cJSON
int32_t dpow_haveutxo(struct supernet_info *myinfo,struct iguana_info *coin,bits256 *txidp,int32_t *voutp,char *coinaddr)
{
int32_t i,j,n,vout,haveutxo = 0; uint32_t r; bits256 txid; cJSON *unspents,*item; uint64_t satoshis; char *str,*address; uint8_t script[35];
int32_t vout,haveutxo = 0; uint32_t i,j,n,r; bits256 txid; cJSON *unspents,*item; uint64_t satoshis; char *str,*address; uint8_t script[35];
memset(txidp,0,sizeof(*txidp));
*voutp = -1;
if ( (unspents= dpow_listunspent(myinfo,coin,coinaddr)) != 0 )
@ -788,9 +788,10 @@ int32_t dpow_haveutxo(struct supernet_info *myinfo,struct iguana_info *coin,bits
"confirmations" : 4282,
"spendable" : true
},*/
r = 0;
memcpy(&r,coin->symbol,3);
r = calc_crc32(0,(void *)&r,sizeof(r));
//r = 0;
//memcpy(&r,coin->symbol,3);
//r = calc_crc32(0,(void *)&r,sizeof(r));
OS_randombytes((uint8_t *)&r,sizeof(r));
for (j=0; j<n; j++)
{
i = (r + j) % n;

Loading…
Cancel
Save