Browse Source

Test

etomic
jl777 8 years ago
parent
commit
9b3029e691
  1. 11
      iguana/exchanges/LP_rpc.c
  2. 11
      iguana/exchanges/LP_transaction.c

11
iguana/exchanges/LP_rpc.c

@ -73,15 +73,11 @@ char *issue_LP_clientgetutxos(char *destip,uint16_t destport,char *coin,int32_t
//return(retstr);
}
change to nanomsg write only, enforce fee, comms api
char *issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port,double profitmargin,int32_t numpeers,int32_t numutxos)
{
char url[512],*retstr;
if ( (retstr= LP_isitme(destip,destport)) != 0 )
{
free(retstr);
return(0);
}
return(retstr);
sprintf(url,"http://%s:%u/api/stats/notify?ipaddr=%s&port=%u&profit=%.6f&numpeers=%d&numutxos=%d",destip,destport,ipaddr,port,profitmargin,numpeers,numutxos);
return(LP_issue_curl("notify",destip,destport,url));
//return(issue_curlt(url,LP_HTTP_TIMEOUT));
@ -91,10 +87,7 @@ char *issue_LP_notifyutxo(char *destip,uint16_t destport,struct LP_utxoinfo *utx
{
char url[4096],str[65],str2[65],str3[65],*retstr; struct _LP_utxoinfo u; uint64_t val,val2;
if ( (retstr= LP_isitme(destip,destport)) != 0 )
{
free(retstr);
return(0);
}
return(retstr);
if ( utxo->iambob == 0 )
{
printf("issue_LP_notifyutxo trying to send Alice %s/v%d\n",bits256_str(str,utxo->payment.txid),utxo->payment.vout);

11
iguana/exchanges/LP_transaction.c

@ -1329,10 +1329,13 @@ int32_t basilisk_alicetxs(int32_t pairsock,struct basilisk_swap *swap,uint8_t *d
int32_t LP_verify_otherfee(struct basilisk_swap *swap,uint8_t *data,int32_t datalen)
{
// add verification and broadcast
memcpy(swap->otherfee.txbytes,data,datalen);
swap->otherfee.I.datalen = datalen;
swap->otherfee.I.actualtxid = swap->otherfee.I.signedtxid = bits256_doublesha256(0,data,datalen);
if ( LP_rawtx_spendscript(swap,swap->bobcoin.longestchain,&swap->otherfee,0,data,datalen,0) == 0 )
{
printf("amount %.8f -> %s\n",dstr(swap->otherfee.I.amount),swap->otherfee.p2shaddr);
//memcpy(swap->otherfee.txbytes,data,datalen);
//swap->otherfee.I.datalen = datalen;
//swap->otherfee.I.actualtxid = swap->otherfee.I.signedtxid = bits256_doublesha256(0,data,datalen);
}
return(0);
}

Loading…
Cancel
Save