|
|
@ -146,7 +146,7 @@ struct LP_utxoinfo *LP_addutxo(char *coin,bits256 txid,int32_t vout,int64_t sato |
|
|
|
struct LP_utxoinfo *utxo = 0; |
|
|
|
if ( coin == 0 || coin[0] == 0 || spendscript == 0 || spendscript[0] == 0 || coinaddr == 0 || coinaddr[0] == 0 || bits256_nonz(txid) == 0 || bits256_nonz(deposittxid) == 0 || vout < 0 || depositvout < 0 || satoshis <= 0 || depositsatoshis <= 0 ) |
|
|
|
{ |
|
|
|
printf("malformed addutxo\n"); |
|
|
|
printf("malformed addutxo %d %d %d %d %d %d %d %d %d %d %d %d\n", coin == 0,coin[0] == 0,spendscript == 0,spendscript[0] == 0,coinaddr == 0,coinaddr[0] == 0,bits256_nonz(txid) == 0,bits256_nonz(deposittxid) == 0,vout < 0,depositvout < 0,satoshis <= 0,depositsatoshis <= 0); |
|
|
|
return(0); |
|
|
|
} |
|
|
|
if ( (utxo= LP_utxofind(txid)) != 0 ) |
|
|
@ -265,13 +265,11 @@ char *issue_LP_notify(char *destip,uint16_t destport,char *ipaddr,uint16_t port, |
|
|
|
|
|
|
|
char *issue_LP_notifyutxo(char *destip,uint16_t destport,struct LP_utxoinfo *utxo) |
|
|
|
{ |
|
|
|
char url[4096],str[65],str2[65],*retstr; |
|
|
|
char url[4096],str[65],str2[65]; |
|
|
|
sprintf(url,"http://%s:%u/api/stats/notifyutxo?ipaddr=%s&port=%u&profit=%.6f&coin=%s&txid=%s&vout=%d&value=%.8f&deposit=%s&dvout=%d&dvalue=%.8f&script=%s&address=%s",destip,destport,utxo->ipaddr,utxo->port,utxo->profitmargin,utxo->coin,bits256_str(str,utxo->txid),utxo->vout,dstr(utxo->satoshis),bits256_str(str2,utxo->deposittxid),utxo->depositvout,dstr(utxo->depositsatoshis),utxo->spendscript,utxo->coinaddr); |
|
|
|
//if ( strlen(url) > 1024 )
|
|
|
|
if ( strlen(url) > 1024 ) |
|
|
|
printf("WARNING long url.(%s)\n",url); |
|
|
|
retstr = issue_curl(url); |
|
|
|
printf("(%s)\n",retstr); |
|
|
|
return(retstr); |
|
|
|
return(issue_curl(url)); |
|
|
|
} |
|
|
|
|
|
|
|
void LP_peersquery(char *destipaddr,uint16_t destport,char *myipaddr,uint16_t myport,double myprofit) |
|
|
|