Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
6d11580ebc
  1. 9
      basilisk/basilisk_bitcoin.c

9
basilisk/basilisk_bitcoin.c

@ -944,22 +944,19 @@ HASH_ARRAY_STRING(basilisk,history,hash,vals,hexstr)
} }
if ( myinfo->numspends > 0 ) if ( myinfo->numspends > 0 )
{ {
spends = cJSON_CreateArray(); //spends = cJSON_CreateArray();
for (i=0; i<myinfo->numspends; i++) for (i=0; i<myinfo->numspends; i++)
{ {
s = &myinfo->spends[i]; s = &myinfo->spends[i];
//struct basilisk_spend { bits256 txid; uint64_t relaymask,value; uint32_t timestamp; int32_t vini,height,unspentheight,ismine; char destaddr[64]; }; //struct basilisk_spend { bits256 txid; uint64_t relaymask,value; uint32_t timestamp; int32_t vini,height,unspentheight,ismine; char destaddr[64]; };
if ( strcmp(s->symbol,coin->symbol) == 0 ) if ( strcmp(s->symbol,coin->symbol) == 0 )
jaddi(spends,basilisk_history_item(&totalspent,s->destaddr,s->value,s->timestamp,s->txid,"vin",s->vini,s->height,"unspentheight",s->unspentheight,s->relaymask,s->ismine)); jaddi(array,basilisk_history_item(&totalspent,s->destaddr,s->value,s->timestamp,s->txid,"vin",s->vini,s->height,"unspentheight",s->unspentheight,s->relaymask,s->ismine));
} }
} }
portable_mutex_unlock(&myinfo->bu_mutex); portable_mutex_unlock(&myinfo->bu_mutex);
retjson = cJSON_CreateObject(); retjson = cJSON_CreateObject();
jaddstr(retjson,"result","success"); jaddstr(retjson,"result","success");
jadd(retjson,"received",array); jadd(retjson,"history",array);
if ( spends == 0 )
spends = cJSON_CreateArray();
jadd(retjson,"sent",spends);
jaddstr(retjson,"coin",coin->symbol); jaddstr(retjson,"coin",coin->symbol);
jaddnum(retjson,"balance",dstr(total)); jaddnum(retjson,"balance",dstr(total));
return(jprint(retjson,1)); return(jprint(retjson,1));

Loading…
Cancel
Save