jl777
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
11 additions and
6 deletions
-
iguana/exchanges/LP_instantdex.c
-
iguana/exchanges/LP_ordermatch.c
-
iguana/exchanges/LP_transaction.c
|
|
@ -473,7 +473,7 @@ int64_t LP_dynamictrust(bits256 pubkey,int64_t kmdvalue) |
|
|
|
swaps_kmdvalue += LP_kmdvalue(sp->Q.destcoin,sp->Q.destsatoshis); |
|
|
|
} |
|
|
|
if ( ap->instantdex_credits != 0 && (swaps_kmdvalue+kmdvalue) > ap->instantdex_credits ) |
|
|
|
//printf("%s instantdex_credits %.8f vs (%.8f + current %.8f)\n",coinaddr,dstr(ap->instantdex_credits),dstr(swaps_kmdvalue),dstr(kmdvalue));
|
|
|
|
printf("%s instantdex_credits %.8f vs (%.8f + current %.8f)\n",coinaddr,dstr(ap->instantdex_credits),dstr(swaps_kmdvalue),dstr(kmdvalue)); |
|
|
|
//if ( ap->instantdex_credits > swaps_kmdvalue+kmdvalue )
|
|
|
|
return(ap->instantdex_credits - (swaps_kmdvalue+kmdvalue)); |
|
|
|
} |
|
|
|
|
|
@ -1347,6 +1347,7 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel |
|
|
|
return(clonestr("{\"error\":\"cant set ordermatch quote info\"}")); |
|
|
|
int32_t changed; |
|
|
|
LP_mypriceset(&changed,autxo->coin,base,1. / maxprice); |
|
|
|
LP_mypriceset(&changed,base,autxo->coin,0.); |
|
|
|
return(LP_trade(ctx,myipaddr,mypubsock,&Q,maxprice,timeout,duration,tradeid,destpubkey)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -951,11 +951,15 @@ int32_t LP_vin_select(int32_t *aboveip,int64_t *abovep,int32_t *belowip,int64_t |
|
|
|
above = gap; |
|
|
|
abovei = i; |
|
|
|
} |
|
|
|
} else gap = (value - atx_value); |
|
|
|
if ( below == 0 || gap < below ) |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
below = gap; |
|
|
|
belowi = i; |
|
|
|
gap = (value - atx_value); |
|
|
|
if ( below == 0 || gap < below ) |
|
|
|
{ |
|
|
|
below = gap; |
|
|
|
belowi = i; |
|
|
|
} |
|
|
|
} |
|
|
|
//printf("value %.8f gap %.8f abovei.%d %.8f belowi.%d %.8f\n",dstr(value),dstr(gap),abovei,dstr(above),belowi,dstr(below));
|
|
|
|
} |
|
|
@ -1218,7 +1222,7 @@ char *LP_createrawtransaction(cJSON **txobjp,int32_t *numvinsp,struct iguana_inf |
|
|
|
return(0); |
|
|
|
} |
|
|
|
memset(utxos,0,sizeof(utxos)); |
|
|
|
if ( (numutxos= LP_address_utxo_ptrs(coin,0,utxos,max,ap,coin->smartaddr)) <= 0 ) |
|
|
|
if ( (numutxos= LP_address_utxo_ptrs(coin,0,utxos,(int32_t)(sizeof(utxos)/sizeof(*utxos)),ap,coin->smartaddr)) <= 0 ) |
|
|
|
{ |
|
|
|
if ( bits256_nonz(utxotxid) == 0 ) |
|
|
|
{ |
|
|
|