mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 09:27:25 +00:00
trading: don't send coins to exchange which have late tx already
This commit is contained in:
parent
a3103af7ba
commit
a9dc8c5dfd
1 changed files with 7 additions and 4 deletions
|
@ -38,7 +38,7 @@ function sellCoinToExchange($coin)
|
|||
$market = getBestMarket($coin);
|
||||
if(!$market) return;
|
||||
|
||||
if(!$coin->sellonbid && $market->lastsent != null && $market->lastsent > $market->lasttraded)
|
||||
if($market->lastsent != null && $market->lastsent > $market->lasttraded)
|
||||
{
|
||||
// debuglog("*** not sending $coin->name to $market->name. last tx is late ***");
|
||||
return;
|
||||
|
@ -77,9 +77,6 @@ function sellCoinToExchange($coin)
|
|||
$amount = round($amount, 8);
|
||||
// debuglog("sending $amount $coin->symbol to $marketname, $deposit_address");
|
||||
|
||||
$market->lastsent = time();
|
||||
$market->save();
|
||||
|
||||
// sleep(1);
|
||||
|
||||
$tx = $remote->sendtoaddress($deposit_address, $amount);
|
||||
|
@ -107,6 +104,12 @@ function sellCoinToExchange($coin)
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if($tx)
|
||||
{
|
||||
$market->lastsent = time();
|
||||
$market->save();
|
||||
}
|
||||
|
||||
$exchange = new db_exchange;
|
||||
$exchange->market = $marketname;
|
||||
|
|
Loading…
Add table
Reference in a new issue