Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
f3750f84d5
  1. 3
      basilisk/basilisk.c
  2. 3
      basilisk/basilisk_bitcoin.c
  3. 2
      iguana/iguana_payments.c

3
basilisk/basilisk.c

@ -63,6 +63,7 @@ cJSON *basilisk_resultsjson(struct supernet_info *myinfo,char *symbol,char *remo
jaddstr(hexjson,"method","result"); jaddstr(hexjson,"method","result");
retjson = basilisk_json(myinfo,hexjson,basilisktag,timeoutmillis); retjson = basilisk_json(myinfo,hexjson,basilisktag,timeoutmillis);
free_json(hexjson); free_json(hexjson);
printf("resultsjson.(%s)\n",jprint(retjson,0));
} }
else // local request else // local request
retjson = hexjson; retjson = hexjson;
@ -278,6 +279,8 @@ char *basilisk_hexmsg(struct supernet_info *myinfo,struct category_info *cat,voi
{ {
printf("basilisk.(%s)\n",jprint(json,0)); printf("basilisk.(%s)\n",jprint(json,0));
//basilisk.({"basilisktag":2955372280,"agent":"basilisk","method":"rawtx","vals":{"changeaddr":"1FNhoaBYzf7safMBjoCsJYgxtah3K95sep","addresses":["1Hgzt5xsnbfc8UTWqWKSTLRm5bEYHYBoCE"],"timeout":5000,"amount":"20000","spendscript":"76a914b7128d2ee837cf03e30a2c0e3e0181f7b9669bb688ac"},"basilisktag":2955372280}) //basilisk.({"basilisktag":2955372280,"agent":"basilisk","method":"rawtx","vals":{"changeaddr":"1FNhoaBYzf7safMBjoCsJYgxtah3K95sep","addresses":["1Hgzt5xsnbfc8UTWqWKSTLRm5bEYHYBoCE"],"timeout":5000,"amount":"20000","spendscript":"76a914b7128d2ee837cf03e30a2c0e3e0181f7b9669bb688ac"},"basilisktag":2955372280})
// basilisk.({"agent":"basilisk","method":"rawtx","activecoin":"BTC","basilisktag":1398466607})
agent = jstr(json,"agent"); agent = jstr(json,"agent");
method = jstr(json,"method"); method = jstr(json,"method");
basilisktag = juint(json,"basilisktag"); basilisktag = juint(json,"basilisktag");

3
basilisk/basilisk_bitcoin.c

@ -579,9 +579,7 @@ char *basilisk_bitcoinrawtx(struct supernet_info *myinfo,struct iguana_info *coi
spendlen = (int32_t)strlen(spendscriptstr) >> 1; spendlen = (int32_t)strlen(spendscriptstr) >> 1;
decode_hex(buf,spendlen,spendscriptstr); decode_hex(buf,spendlen,spendscriptstr);
bitcoin_txoutput(coin,txobj,buf,spendlen,amount); bitcoin_txoutput(coin,txobj,buf,spendlen,amount);
printf("call calcrawtx\n");
rawtx = iguana_calcrawtx(myinfo,coin,&vins,txobj,amount,changeaddr,txfee,addresses,minconf); rawtx = iguana_calcrawtx(myinfo,coin,&vins,txobj,amount,changeaddr,txfee,addresses,minconf);
printf("back calcrawtx\n");
} else printf("error creating txobj\n"); } else printf("error creating txobj\n");
} //else rawtx = bitcoin_calcrawtx(myinfo,coin,vinsp,satoshis,spendscriptstr,changeaddr,txfee,addresses,minconf,locktime); } //else rawtx = bitcoin_calcrawtx(myinfo,coin,vinsp,satoshis,spendscriptstr,changeaddr,txfee,addresses,minconf,locktime);
if ( rawtx != 0 ) if ( rawtx != 0 )
@ -607,6 +605,7 @@ char *basilisk_bitcoinrawtx(struct supernet_info *myinfo,struct iguana_info *coi
jaddstr(hexjson,"agent","basilisk"); jaddstr(hexjson,"agent","basilisk");
jaddstr(hexjson,"method","rawtx"); jaddstr(hexjson,"method","rawtx");
jaddstr(hexjson,"activecoin",coin->symbol); jaddstr(hexjson,"activecoin",coin->symbol);
jadd(hexjson,"vals",jduplicate(valsobj));
if ( (ptr= basilisk_issue(myinfo,hexjson,timeoutmillis,0,1,basilisktag)) != 0 ) if ( (ptr= basilisk_issue(myinfo,hexjson,timeoutmillis,0,1,basilisktag)) != 0 )
{ {
for (i=0; i<ptr->numresults; i++) for (i=0; i<ptr->numresults; i++)

2
iguana/iguana_payments.c

@ -321,13 +321,11 @@ char *iguana_calcrawtx(struct supernet_info *myinfo,struct iguana_info *coin,cJS
*vinsp = 0; *vinsp = 0;
max = 10000; max = 10000;
unspents = calloc(max,sizeof(*unspents)); unspents = calloc(max,sizeof(*unspents));
printf("unspentslist\n");
if ( (num= iguana_unspentslists(myinfo,coin,&avail,unspents,max,satoshis,minconf,addresses)) <= 0 ) if ( (num= iguana_unspentslists(myinfo,coin,&avail,unspents,max,satoshis,minconf,addresses)) <= 0 )
{ {
free(unspents); free(unspents);
return(0); return(0);
} }
printf("got num.%d\n",num);
if ( txobj != 0 && avail >= satoshis+txfee ) if ( txobj != 0 && avail >= satoshis+txfee )
{ {
if ( (vins= iguana_inputsjson(myinfo,coin,&total,satoshis + txfee,unspents,num)) != 0 ) if ( (vins= iguana_inputsjson(myinfo,coin,&total,satoshis + txfee,unspents,num)) != 0 )

Loading…
Cancel
Save