mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-26 05:10:33 +00:00
wallet: update db balances after manual send
This commit is contained in:
parent
1e72d4fb81
commit
f11285087f
3 changed files with 15 additions and 1 deletions
|
@ -343,7 +343,19 @@ function BackendUpdatePoolBalances($coinid = NULL)
|
|||
{
|
||||
$t1 = microtime(true);
|
||||
|
||||
$sqlFilter = $coinid ? "id=".intval($coinid) : 'enable=1';
|
||||
$sqlFilter = 'enable=1';
|
||||
|
||||
if ($coinid) { // used from wallet manual send
|
||||
$sqlFilter = "id=".intval($coinid);
|
||||
// refresh balance field from the wallet info
|
||||
$coin = getdbo('db_coins', $coinid);
|
||||
$remote = new WalletRPC($coin);
|
||||
$info = $remote->getinfo();
|
||||
if(isset($info['balance'])) {
|
||||
$coin->balance = $info['balance'];
|
||||
$coin->save();
|
||||
}
|
||||
}
|
||||
|
||||
$coins = getdbolist('db_coins', $sqlFilter);
|
||||
foreach($coins as $coin)
|
||||
|
|
|
@ -85,6 +85,7 @@ class MarketController extends CommonController
|
|||
} else {
|
||||
$market->lastsent = time();
|
||||
$market->save();
|
||||
BackendUpdatePoolBalances($coin->id);
|
||||
}
|
||||
|
||||
$exchange = new db_exchange;
|
||||
|
|
|
@ -252,6 +252,7 @@ class SiteController extends CommonController
|
|||
debuglog("sent $amount {$coin->symbol} to bookmark {$bookmark->address}");
|
||||
$bookmark->lastused = time();
|
||||
$bookmark->save();
|
||||
BackendUpdatePoolBalances($coin->id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue