mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-16 07:29:44 +00:00
payments: handle payout_max field, to enhance later
This commit is contained in:
parent
e0d65b0fad
commit
c74cfff0fc
1 changed files with 5 additions and 2 deletions
|
@ -51,8 +51,8 @@ function BackendCoinPayments($coin)
|
||||||
|
|
||||||
$users = getdbolist('db_accounts', "balance>$min_payout and coinid={$coin->id}");
|
$users = getdbolist('db_accounts', "balance>$min_payout and coinid={$coin->id}");
|
||||||
|
|
||||||
// todo: db field
|
// todo: enhance/detect payout_max from normal sendmany error
|
||||||
if($coin->symbol == 'MUE' || $coin->symbol == 'BOD' || $coin->symbol == 'DIME' || $coin->symbol == 'BTCRY')
|
if($coin->symbol == 'MUE' || $coin->symbol == 'BOD' || $coin->symbol == 'DIME' || $coin->symbol == 'BTCRY' || !empty($coin->payout_max))
|
||||||
{
|
{
|
||||||
foreach($users as $user)
|
foreach($users as $user)
|
||||||
{
|
{
|
||||||
|
@ -69,6 +69,9 @@ function BackendCoinPayments($coin)
|
||||||
debuglog("error $remote->error, $user->username, $amount");
|
debuglog("error $remote->error, $user->username, $amount");
|
||||||
if($remote->error == 'transaction too large' || $remote->error == 'invalid amount')
|
if($remote->error == 'transaction too large' || $remote->error == 'invalid amount')
|
||||||
{
|
{
|
||||||
|
$coin->payout_max = min((double) $amount, (double) $coin->payout_max);
|
||||||
|
$coin->save();
|
||||||
|
|
||||||
$amount /= 2;
|
$amount /= 2;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue