@ -195,7 +195,7 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str
printf ( " destvalue %.8f destsatoshis %.8f is too small txfee %.8f? \n " , dstr ( destvalue ) , dstr ( qp - > destsatoshis ) , dstr ( qp - > desttxfee ) ) ;
return ( - 11 ) ;
}
if ( butxo ! = 0 & & srcvalue < qp - > txfee + qp - > satoshis )
if ( strcmp ( srccoin , " ETOMIC " ) ! = 0 & & butxo ! = 0 & & srcvalue < qp - > txfee + qp - > satoshis )
{
printf ( " srcvalue %.8f [%.8f] satoshis %.8f is too small txfee %.8f? \n " , dstr ( srcvalue ) , dstr ( srcvalue ) - dstr ( qp - > txfee + qp - > satoshis ) , dstr ( qp - > satoshis ) , dstr ( qp - > txfee ) ) ;
return ( - 33 ) ;
@ -213,7 +213,7 @@ double LP_quote_validate(struct LP_utxoinfo *autxo,struct LP_utxoinfo *butxo,str
printf ( " error -14: txfee %.8f < %.8f or desttxfee %.8f < %.8f \n " , dstr ( qp - > txfee ) , dstr ( LP_REQUIRED_TXFEE * txfee ) , dstr ( qp - > desttxfee ) , dstr ( LP_REQUIRED_TXFEE * desttxfee ) ) ;
return ( - 14 ) ;
}
if ( butxo ! = 0 )
if ( butxo ! = 0 & & strcmp ( srccoin , " ETOMIC " ) ! = 0 )
{
if ( qp - > satoshis < ( srcvalue / LP_MINVOL ) | | srcvalue < qp - > txfee * LP_MINSIZE_TXFEEMULT )
{
@ -413,14 +413,22 @@ struct LP_utxoinfo *LP_address_myutxopair(struct LP_utxoinfo *butxo,int32_t iamb
memset ( butxo , 0 , sizeof ( * butxo ) ) ;
if ( iambob ! = 0 )
{
targetval = LP_basesatoshis ( relvolume , price , txfee , desttxfee ) + 3 * txfee ;
if ( strcmp ( coin - > symbol , " ETOMIC " ) = = 0 ) {
targetval = 100000000 + 3 * txfee ;
} else {
targetval = LP_basesatoshis ( relvolume , price , txfee , desttxfee ) + 3 * txfee ;
}
targetval2 = ( targetval / 8 ) * 9 + 3 * txfee ;
fee = txfee ;
ratio = LP_MINVOL ;
}
else
{
targetval = relvolume * SATOSHIDEN + 3 * desttxfee ;
if ( strcmp ( coin - > symbol , " ETOMIC " ) = = 0 ) {
targetval = 100000000 + 3 * desttxfee ;
} else {
targetval = relvolume * SATOSHIDEN + 3 * desttxfee ;
}
targetval2 = ( targetval / 777 ) + 3 * desttxfee ;
fee = desttxfee ;
ratio = LP_MINCLIENTVOL ;
@ -906,7 +914,7 @@ double LP_trades_pricevalidate(struct LP_quoteinfo *qp,struct iguana_info *coin,
printf ( " quote %s/%s validate error %.0f \n " , qp - > srccoin , qp - > destcoin , qprice ) ;
return ( - 3 ) ;
}
if ( qprice < ( price - 0.00000001 ) * 0.998 )
if ( qprice < ( price - 0.00000001 ) * 0.998 )
{
printf ( " quote price %.8f (%llu/%llu %.8f) too low vs %.8f for %s/%s price %.8f %.8f \n " , qprice , ( long long ) qp - > destsatoshis , ( long long ) ( qp - > satoshis - qp - > txfee ) , ( double ) qp - > destsatoshis / ( qp - > satoshis - qp - > txfee ) , price , qp - > srccoin , qp - > destcoin , price , ( price - 0.00000001 ) * 0.998 ) ;
return ( - 77 ) ;
@ -1009,7 +1017,11 @@ struct LP_quoteinfo *LP_trades_gotrequest(void *ctx,struct LP_quoteinfo *qp,stru
qp - > vout = butxo - > payment . vout ;
qp - > txid2 = butxo - > deposit . txid ;
qp - > vout2 = butxo - > deposit . vout ;
qp - > satoshis = butxo - > swap_satoshis ; // + qp->txfee;
if ( coin - > etomic [ 0 ] = = 0 ) {
qp - > satoshis = butxo - > swap_satoshis ; // + qp->txfee;
} else {
qp - > satoshis = LP_basesatoshis ( dstr ( qp - > destsatoshis ) , price , qp - > txfee , qp - > desttxfee ) ;
}
qp - > quotetime = ( uint32_t ) time ( NULL ) ;
}
else